home *** CD-ROM | disk | FTP | other *** search
/ PC Media 23 / PC MEDIA CD23.iso / share / prog / gapcdr1 / gapcdr.txt < prev    next >
Encoding:
Text File  |  1995-01-03  |  162.6 KB  |  6,618 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.                          GAP Communications Online Software
  29.  
  30.  
  31.  
  32.  
  33.                                        GAPCDR
  34.  
  35.                                Door Interface Library
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.           Copyright (C) 1987-1994 by GAP Development Company.
  43.  
  44.  
  45.           ALL RIGHTS  RESERVED. No part of this manual shall be reproduced,
  46.           stored in  a retrieval  system,  or  transmitted  by  any  means,
  47.           electronic, mechanical,  photocopying, recording,  or  otherwise,
  48.           without written  permission from  GAP Development  Company. While
  49.           every precaution  has been  taken  in  the  preparation  of  this
  50.           manual, GAP  Development Company  assumes no  responsibility  for
  51.           errors or omissions. Neither is any liability assumed for damages
  52.           resulting from the use of the information contained herein.
  53.  
  54.  
  55.           GAPCDR is  the sole  and exclusive  property of  GAP  Development
  56.           Company. It  is licensed  and not  sold  to  the  end  user  with
  57.           restrictions placed upon its use.
  58.  
  59.  
  60.           GAPCDR is copyrighted by GAP Development Company.
  61.           DESQview is a trademark of Quarterdeck.
  62.           PCBoard is a trademark of Clark Development Corporation.
  63.           WildCat! is copyrighted by Mustang Software.
  64.           DigiBoard is a trademark of DigiBoard Incorporated.
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.           Contents
  72.  
  73.  
  74.  
  75.           Description                                                     5
  76.  
  77.                Major Features                                             5
  78.  
  79.  
  80.           Getting Started                                                 7
  81.  
  82.                Supported Compilers                                        8
  83.                Using GAPCDR                                               8
  84.                Points To Remember                                        11
  85.                Compiling And Linking                                     12
  86.                Using A Goto                                              13
  87.                BBS System Files                                          14
  88.  
  89.  
  90.           Sysop Setup And Functions                                      14
  91.  
  92.                Configuration                                             15
  93.                Sysop Functions                                           17
  94.  
  95.  
  96.           Advanced Applications                                          18
  97.  
  98.                Communications                                            18
  99.                DOS Window                                                20
  100.  
  101.  
  102.           Variables                                                      22
  103.  
  104.                Defines                                                   22
  105.                Ansi Variables                                            22
  106.                DOOR.SYS Variables                                        23
  107.                Global Variables                                          25
  108.  
  109.  
  110.           Functions - Quick Reference                                    27
  111.  
  112.  
  113.  
  114.           Functions - Detailed Reference                                 28
  115.  
  116.  
  117.  
  118.           Index                                                         104
  119.  
  120.  
  121.  
  122.                                        Page 3
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.                                        Page 4
  181.  
  182.  
  183.  
  184.           GAP Communications                                         GAPCDR
  185.  
  186.  
  187.  
  188.  
  189.           Description
  190.  
  191.  
  192.           GAPCDR is  a professional development kit for Bulletin Board Door
  193.           programmers. Written in Microsoft C version 7 and MASM version 6,
  194.           it is  fast, reliable,  easy to use, and easy to incorporate into
  195.           the serious  programmer's source  code. It consists of a set of C
  196.           and assembler library routines to allow for easy door programming
  197.           and interfacing. Borland C compatability is included.
  198.  
  199.  
  200.           Major Features
  201.  
  202.              Interfaces with  GAP Communications,  PCBoard, WildCat, and
  203.              other fine  BBS programs  that are  capable  of  writing  a
  204.              DOOR.SYS file.
  205.  
  206.              Full communications  support including the DigiBoard COM/Xi
  207.              series of  Intelligent Multi-Port  boards as well as Fossil
  208.              Drivers.
  209.  
  210.              Supports the FIFO buffers of the 16550 UART chip.
  211.  
  212.              Speeds up to 115,200 baud.
  213.  
  214.              Communications ports other than Com 1 and Com 2 possible.
  215.  
  216.              Supports CTS/RTS, automatically.
  217.  
  218.              Does not require watchdog or CTTY.
  219.  
  220.              Fully self contained, built in ANSI driver.
  221.  
  222.              Sysop sees what the caller sees.
  223.  
  224.              High speed text file display.
  225.  
  226.              Supports  ANSI   color  and   ASCII  text   files  with  no
  227.              programming effort  other than  to make  a single  function
  228.              call.
  229.  
  230.              Easy to use Random Number Generator.
  231.  
  232.              Informative Status Line display.
  233.  
  234.              Monitors keyboard activity and caller time remaining.
  235.  
  236.  
  237.  
  238.                                        Page 5
  239.  
  240.  
  241.  
  242.           GAP Communications                                         GAPCDR
  243.  
  244.  
  245.              Easy interface to BBS system.
  246.  
  247.              Sysop chat with full word wrapping.
  248.  
  249.              Allows the sysop to shell to DOS.
  250.  
  251.              "Remembers" the  default drive and directory which prevents
  252.              file access errors.
  253.  
  254.              Credits caller  with time  spent chatting or while sysop is
  255.              in a DOS shell.
  256.  
  257.              Sysop can twit caller without caller ever knowing the sysop
  258.              is watching.
  259.  
  260.              Caller time can be increased or decreased.
  261.  
  262.              Full programmer control of whether or not to update the BBS
  263.              system files.
  264.  
  265.              Time calculations  are not  dependent on the "seconds since
  266.              midnight" and  are thus  unsusceptible to the midnight roll
  267.              over.
  268.  
  269.              Timer routines are hardware independent.
  270.  
  271.              Automatic detection of multi-user system.
  272.  
  273.              Input routines are consistent throughout the program.
  274.  
  275.              Uses the latest in Microsoft C and MASM features.
  276.  
  277.              Extremely easy interfacing to door programs.
  278.  
  279.              Fully DESQView aware video routines as well as keyboard and
  280.              COM input routines, and COM output routines.
  281.  
  282.  
  283.  
  284.           GAPCDR includes  robust Communications  routines which  are fully
  285.           interrupt driven. Written in highly optimized assembler, they are
  286.           capable of  operating at  any speed which the UART on an IBM type
  287.           of computer  is capable  of producing.  The FIFO  buffers in  the
  288.           16550 UART  are fully  supported. CTS/RTS  checking is automatic,
  289.           and  carrier   detect  is   an  integral  part  of  each  of  the
  290.           communications input and output routines. When there is a loss of
  291.           carrier, a  function in the main GAPCDR code will be called. This
  292.  
  293.  
  294.  
  295.  
  296.                                        Page 6
  297.  
  298.  
  299.  
  300.           GAP Communications                                         GAPCDR
  301.  
  302.  
  303.           function defaults  to shutting down the door and returning to the
  304.           BBS, however you may modify it to do whatever you wish.
  305.  
  306.           The built  in ANSI driver makes GAPCDR a self contained unit. The
  307.           driver is  smart enough  to know when a caller does not want ANSI
  308.           sequences sent  to his  computer and  it will filter out any such
  309.           codes that  pass through  it. This  allows you  to create prompts
  310.           with embedded  ANSI sequences  and display them without regard as
  311.           to whether  or not  the caller  has color  "turned on". This also
  312.           means you do not have to keep two sets of prompts (one with color
  313.           attributes and  one without).  This is  a great savings to you in
  314.           precious DATA  space. You  may also  use the  ANSI driver to send
  315.           color strings to the local monitor. Even if the caller is in mono
  316.           mode, you  may still  send color  strings and prompts to the ANSI
  317.           driver and have them displayed in color on the local monitor.
  318.  
  319.           GAPCDR supports  only the  DOOR.SYS  format  for  passing  caller
  320.           information to  a door.  We choose  this format  because  of  its
  321.           universal acceptance  and its  inherent ability to remain stable.
  322.           BBS programs  frequently change  and with  those changes  usually
  323.           come modifications  to the  system files  they create to interact
  324.           with door  programs. DOOR.SYS  on the  other hand was designed to
  325.           include as  much  information  about  a  caller  as  was  thought
  326.           necessary. Should  new fields  be needed  to take care of new BBS
  327.           features, it  is a  simple matter  to add these new fields to the
  328.           end of  the file,  thereby making the new version compatible with
  329.           all prior versions. Most major BBS programs support DOOR.SYS.
  330.  
  331.  
  332.  
  333.           Getting Started
  334.  
  335.  
  336.           GAPCDR is  distributed in  archived format.  The contents  of the
  337.           archive should be as follows:
  338.  
  339.             GAPCDR.TXT      - Disk based documentation.
  340.             GAPCDRS.LIB     - Small model Library routines.
  341.             GAPCDRL.LIB     - Large model Library routines.
  342.             GAPCDBS.LIB     - Small model Library routines for BC.
  343.             GAPCDBL.LIB     - Large model Library routines for BC.
  344.             GAPCDR.H        - Door Interface include file.
  345.             GAPSTRUC.H      - Door Interface include file.
  346.             CDOOR.ZIP       - Sample program  illustrating many  of the
  347.                               features of GAPCDR.
  348.             READ.ME         - Any  pertinent   information  which   you
  349.                               should read.
  350.  
  351.  
  352.  
  353.  
  354.                                        Page 7
  355.  
  356.  
  357.  
  358.           GAP Communications                                         GAPCDR
  359.  
  360.  
  361.           If you  licensed the  source code to GAPCDR you will receive most
  362.           of the ASM, C, INC, H, BAT, and OBJ files that make up the GAPCDR
  363.           library. We  include both  Microsoft and  Borland batch  files to
  364.           compile the source modules.
  365.  
  366.  
  367.           Supported Compilers
  368.  
  369.           We used  the Microsoft  C compiler  version 8.x,  the Borland C++
  370.           Compiler  version  4.x,  and  MASM  version  6.  The  linker  and
  371.           librarian were from their respective compilers.
  372.  
  373.           Since GAPCDR  uses no  floating point  math, the  C modules  were
  374.           compiled with  the /FPa switch for Microsoft. This is the default
  375.           for Borland,  so no  switches are  necessary. For Microsoft C, in
  376.           order to  use the  /FPa switch,  you must  tell the SETUP program
  377.           that you  want to create the Alternate Floating Point library. It
  378.           will then  create a  set of  libraries that  make  calls  to  the
  379.           Alternate Math  library instead  of  the  Emulator  Library.  The
  380.           difference in  code size  for a large model program that uses the
  381.           Alternate library as opposed to the Emulator library is typically
  382.           around 10k.  Even if  you do not use floating point arithmetic in
  383.           your program, the Math Library will still be linked in because it
  384.           contains the  routines to do long arithmetic. So, the smaller the
  385.           library, the smaller your programs!
  386.  
  387.           Place the  GAPCDR files in your work directory. You may place the
  388.           LIB files in the MSC\LIB or BORLAND\LIB directory.
  389.  
  390.           The text  editor you  use must  allow control  characters  to  be
  391.           entered and  displayed. The  ANSI variables  are initialized with
  392.           literal characters  and if  your editor removes the ESC character
  393.           from the strings, your ANSI displays will be quite messy.
  394.  
  395.  
  396.           Using GAPCDR
  397.  
  398.           At the  very beginning  of your  program, you  must  include  the
  399.           GAPCDR.H file.  Without this  file,  nothing  will  work.  It  is
  400.           normally included  after the C header files that your program may
  401.           need. To include the file, you type the following after including
  402.           the regular C header files:
  403.  
  404.                #include "gapcdr.h"
  405.  
  406.           GAPCDR.H  contains  the  declarations  for  the  external  global
  407.           variables. In addition, it includes GAPSTRUC.H which contains the
  408.           structure declarations and the function prototypes.
  409.  
  410.  
  411.  
  412.                                        Page 8
  413.  
  414.  
  415.  
  416.           GAP Communications                                         GAPCDR
  417.  
  418.  
  419.                Note: Any  of your source modules that include GAPCDR.H
  420.                must have  an include  declaration for STDIO.H prior to
  421.                including GAPCDR.H.  It should  be standard practice to
  422.                include STDIO.H  in your source modules anyway, so this
  423.                shouldn't present any problems.
  424.  
  425.           The first  thing that must be done prior to using any of the door
  426.           functions, is  to initialize  GAPCDR itself. This is accomplished
  427.           by making  a call  to read_cnf.  Read_cnf opens the configuration
  428.           file (the  name of  which you  pass as  a parameter  on the  door
  429.           command line) and reads the first eight lines of the file. If the
  430.           configuration file  cannot be  found, the  program will  end. The
  431.           format of the configuration file is as follows:
  432.  
  433.  
  434.  
  435.                            c:\gap
  436.                            The Crow's Nest
  437.                            0
  438.                            0
  439.                            STANDARD
  440.                            D000
  441.                            320
  442.                            4
  443.  
  444.  
  445.           The first  line of  the file  is the  path  to  the  BBS  default
  446.           directory. The second line is the name of the BBS. The third line
  447.           is the Port IRQ and the 4th line is the Port Base Address. If the
  448.           sysop running  your program  has his  BBS configured  to use  Com
  449.           Ports other  than 1  or 2,  he would  then enter the IRQ and Base
  450.           address for  his Com  Port on  lines 3  and 4. GAPCDR derives the
  451.           Port Number from the DOOR.SYS file.
  452.  
  453.           Lines five through eight are for the Intelligent DigiBoard multi-
  454.           port Communications  Card. The  DigiBoard  routines  specifically
  455.           support the  COM/Xi series.  All four of these lines are required
  456.           even if  your end  users are  using the  Standard Interface. Line
  457.           five is  the Communications Port Interface. It must be one of the
  458.           following:
  459.  
  460.                     STANDARD    DIGIBOARD   INT14/EBIOS    FOSSIL
  461.  
  462.           The Standard  interface is the one that will normally be used. If
  463.           an end  user is  using a  DigiBoard then  either the DigiBoard or
  464.           Int14/EBIOS interface  may be  selected. Most sysops will use the
  465.           Int14/EBIOS interface.  All  input/output  to  the  DigiBoard  is
  466.           performed via  Interrupt 14  calls and a Device Driver (available
  467.  
  468.  
  469.  
  470.                                        Page 9
  471.  
  472.  
  473.  
  474.           GAP Communications                                         GAPCDR
  475.  
  476.  
  477.           from DigiBoard) handles the interface between the program and the
  478.           board. The  DigiBoard interface  uses Direct  Programming. GAPCDR
  479.           talks to the board directly without the need for a Device Driver.
  480.           In order  to use  this interface,  a program  called RESETDIG.EXE
  481.           must be used in the AUTOEXEC.BAT file to reset the DigiBoard once
  482.           when the  computer is first booted. If the end user does not have
  483.           this program (it is a part of the GAP Communications BBS package)
  484.           then the Int14/EBIOS interface must be used.
  485.  
  486.           The Fossil  interface is  specified when a user is using a Fossil
  487.           Device Driver (either BNU or X00). The Fossil interface also uses
  488.           Interrupt 14 calls that are specific to Fossil drivers.
  489.  
  490.           If the  Interface is  set to  STANDARD or  FOSSIL, then  lines  6
  491.           through 8  will be ignored. If the Interface is INT14/EBIOS, then
  492.           lines 6 and 7 will be ignored.
  493.  
  494.           Line 6  is the  DigiBoard Memory Window, or the address the board
  495.           uses as  a  communications  area  between  itself  and  the  Host
  496.           Computer. This  line is  used only  if the  Interface is  set  to
  497.           DIGIBOARD. It  can be  set to  0 if  the Interface  is  STANDARD,
  498.           INT14/EBIOS, or FOSSIL.
  499.  
  500.           Line 7  is the DigiBoard I/O Port Address. This line is used only
  501.           if the  Interface is  set to  DIGIBOARD  and  can  be  set  to  0
  502.           otherwise.
  503.  
  504.           Line 8 is the DigiBoard Channel Number. This line is required for
  505.           the DIGIBOARD  and INT14/EBIOS  Interfaces. It  is normally 1 - 8
  506.           for the  DIGIBOARD Interface  and 4  -  11  for  the  INT14/EBIOS
  507.           Interface. The  Channel Number  is similar  to a  Port Number. It
  508.           tells the  program which of the DigiBoard Communications ports to
  509.           use.
  510.  
  511.           The configuration  file is  usually given  a name  similar to the
  512.           name of  your door  program, with  a CNF extension. Read_cnf will
  513.           leave this  file open for your use. If you have any configuration
  514.           options of  your own,  you may  place them in this file beginning
  515.           with line  9. Do  not read your configuration options until after
  516.           making a  call to  init_door (which should be the second function
  517.           call in  your program).  Upon return from init_door, you are free
  518.           to read  your configuration  options (if  any). At this time, you
  519.           should close the configuration file.
  520.  
  521.           Normally, your  program is  invoked with a command line parameter
  522.           giving the name of the configuration file to use:
  523.  
  524.                DOOR DOOR.CNF
  525.  
  526.  
  527.  
  528.                                        Page 10
  529.  
  530.  
  531.  
  532.           GAP Communications                                         GAPCDR
  533.  
  534.  
  535.           You would use the argv parameter to your main function to extract
  536.           the configuration  parameter and  then pass  this parameter on to
  537.           read_cnf. This  allows the end user to use a single program (your
  538.           program) with  multiple configuration  files. This  is especially
  539.           important under  multi-user systems  where separate configuration
  540.           files are needed.
  541.  
  542.           The configuration  file is  opened as a stream, so using fgets or
  543.           any of  the stream  input  functions  would  be  appropriate  for
  544.           reading the  data. Remember  that the file pointer is passed back
  545.           to you  after the  call to  read_cnf. An example of the first few
  546.           "door" statements that might appear in a source file would be:
  547.  
  548.              FILE *cnf_file;                 // pointer to config file
  549.  
  550.              cnf_file = read_cnf(argv[1]);   // read the cnf file
  551.              init_door();                    // init the door
  552.              fclose(cnf_file);               // close the cnf file
  553.  
  554.  
  555.           If there  were no errors, read_cnf will return. You must now make
  556.           a call  to init_door. Init_door uses the information derived from
  557.           line 1  of the  configuration file  to open and read DOOR.SYS. In
  558.           addition, init_door  opens the  communications port  (if a remote
  559.           user is  on), initializes  some global variables, initializes the
  560.           random  number   generator,  initializes  the  ANSI  driver,  and
  561.           installs a  Ctrl-Break handler.  If there  is an error, init_door
  562.           will not return. Instead it will end the program.
  563.  
  564.           That is  basically all  you have  to do  to initialize the GAPCDR
  565.           module. When  your  program  ends,  you  should  clean  house  if
  566.           necessary and  call leave.  Leave closes  the communications port
  567.           and any  open files,  restores the ISR routines to their original
  568.           state, sends  a sign off message to the caller, and then exits to
  569.           DOS. It  is of vital importance to exit the door by making a call
  570.           to leave.  Failure to  do so  will leave communication interrupts
  571.           active and  the ctrl-break intercept active. The vectors to these
  572.           routines will  be left  in the  interrupt vector  table  and  the
  573.           computer will surely lock up the first time any program is run.
  574.  
  575.  
  576.           Points To Remember
  577.  
  578.              To get  the ball  rolling, include  GAPCDR.H  after  the  C
  579.              header files.
  580.  
  581.              To initialize the door, call read_cnf with the name of your
  582.              program's configuration file. Then call init_door.
  583.  
  584.  
  585.  
  586.                                        Page 11
  587.  
  588.  
  589.  
  590.           GAP Communications                                         GAPCDR
  591.  
  592.  
  593.              Call leave when your program is finished.
  594.  
  595.              All input and output should be performed through the GAPCDR
  596.              functions. The sample program gives good examples on how to
  597.              accomplish this.  If you  use the C runtime output routines
  598.              such as  printf or  cputs, the  local screen will be a mess
  599.              because the  internal ANSI  driver will  not know where the
  600.              cursor is.
  601.  
  602.              To determine  if the  BBS is a single or multi user system,
  603.              check the  variable called  multi. If  it is anything other
  604.              than  0,   then  the  BBS  is  multi-user  and  you  should
  605.              read/write your data files with sharing attributes.
  606.  
  607.              Do not  use any  of the  BBS  specific  functions  such  as
  608.              read_pcbsys or  read_gapuser  unless  you  know  that  your
  609.              program is running with the appropriate BBS system. You may
  610.              want to  use a flag in your configuration file to determine
  611.              which system  your program is running with. These functions
  612.              were provided  to make  your programming choores easier but
  613.              using them  basically restricts your door to the respective
  614.              BBS system that the functions interact with.
  615.  
  616.              To test  your program,  you will  need a DOOR.SYS file that
  617.              was written  for local  exit. Of  course,  you  can  always
  618.              modify any  DOOR.SYS file and change the first line so that
  619.              it reads COM0:. A complete set of sample files are provided
  620.              for testing your program under local mode.
  621.  
  622.  
  623.           Compiling And Linking
  624.  
  625.           GAPCDR has  already been compiled with the necessary compile time
  626.           switches for both Microsoft C and Borland C.
  627.  
  628.           To compile  your programs, use whatever switches are required for
  629.           your compiler.
  630.  
  631.             Microsoft C
  632.  
  633.             cl /c /FPa door.c
  634.             link door,,NUL.MAP,+GAPCDRx
  635.  
  636.             Borland C
  637.  
  638.             bcc -c door.c
  639.             tlink c0x+door,door.exe,NUL.MAP,+GAPCDRBx+Cx
  640.  
  641.  
  642.  
  643.  
  644.                                        Page 12
  645.  
  646.  
  647.  
  648.           GAP Communications                                         GAPCDR
  649.  
  650.  
  651.           Where door  is the  name of  your program  and 'x' is 'S' for the
  652.           small model library or 'L' for the large model library.
  653.  
  654.           As was  mentioned previously,  GAPCDR was  compiled with the /FPa
  655.           option  for   Microsoft  C.  The  /FPa  option  produces  smaller
  656.           executable files.
  657.  
  658.           If you licensed the source code to GAPCDR, there are suplementary
  659.           files to aid in re-compiling and librarying the source modules.
  660.  
  661.           GAPCDR will  only compile  with Microsoft  C version 7 or greater
  662.           and Borland C version 4 or greater.
  663.  
  664.           GAPCDR uses  the PASCAL  function calling  convention. If you are
  665.           unfamiliar  with  this  calling  convention  it  means  that  the
  666.           parameters to  a function  are pushed onto the stack from left to
  667.           right instead  of right  to left. In addition, the function being
  668.           called is  responsible for  removing arguments from the stack. In
  669.           the C  calling  convention,  the  function  making  the  call  is
  670.           responsible for  restoring the  stack. What  this means is if you
  671.           make 10  calls to show_mess, there will be 10 instances where the
  672.           stack must  be restored  upon return  from the  function. In  the
  673.           PASCAL convention,  there will  be only  one instance  where this
  674.           will occur  and it  will be in show_mess just prior to the actual
  675.           return. The  end result of using the PASCAL calling convention is
  676.           smaller code size.
  677.  
  678.           It should be noted that the PASCAL convention cannot be used with
  679.           functions that  take a variable number of arguments. In addition,
  680.           using  the   PASCAL  convention   absolutely  requires  that  all
  681.           functions be  prototyped. Otherwise  the compiler  will  generate
  682.           redeclaration errors  and the  linker  will  generate  unresolved
  683.           external reference errors.
  684.  
  685.  
  686.           Using A Goto
  687.  
  688.           A word  about using  goto. If  you licensed  the source  code  to
  689.           GAPCDR, you  will find that we use the goto in several places. It
  690.           should be  pointed out  that speed and compactness, combined with
  691.           readability, are  our number  one concerns.  We performed several
  692.           experiments with  the goto.  We took  a very simple function that
  693.           consisted of  a while  loop and  a few statements embodied within
  694.           the loop.  We took  the same  function and  rewrote  it  using  a
  695.           counter variable  and a  goto and  removed the  while  loop.  The
  696.           assembler output  and resultant  object code  was 1/2 the size as
  697.           that of the function that used the while loop.
  698.  
  699.  
  700.  
  701.  
  702.                                        Page 13
  703.  
  704.  
  705.  
  706.           GAP Communications                                         GAPCDR
  707.  
  708.  
  709.           We are  not proposing that anyone give up the fine structure of C
  710.           and use  gotos as  a beginning  programmer in  Basic might do. In
  711.           fact, if  you are  a beginning  programmer in C, you should avoid
  712.           using gotos altogether until you become more proficient.
  713.  
  714.  
  715.           BBS System Files
  716.  
  717.           Since we  are firm  believers that the BBS system files belong to
  718.           the BBS  and should  not be altered by any door program, updating
  719.           the BBS  system file  is not  automatic. If  you  wish  that  any
  720.           decrease or  increase in  the user's  time (kept  track of in the
  721.           timecredit  variable),   be  made   permanent,  you   may,  after
  722.           initializing the  door, call  the function  that opens the system
  723.           file. For  PCB, this would be PCBOARD.SYS. Keep track of any time
  724.           credits  during  the  door  programs  operation,  then  call  the
  725.           function that  updates the  BBS system  file. For  GAP, you would
  726.           need to re-write DOOR.SYS with any updated information.
  727.  
  728.  
  729.  
  730.           Sysop Setup And Functions
  731.  
  732.  
  733.           These sysop  setup and  function descriptions should be placed in
  734.           the documentation  of your  door program.  You should, of course,
  735.           change the setup information to fit your particular needs.
  736.  
  737.           Door programs  written with the GAPCDR Door Interface Module will
  738.           run on any BBS system that is capable of writing a DOOR.SYS file.
  739.           For GAP  Communications and  WildCat, you need do nothing special
  740.           when configuring your doors. These programs will write a DOOR.SYS
  741.           file automatically.  For PCBoard,  you must  explicitly tell  the
  742.           Door File  editor to  write a  DOOR.SYS file,  when setting  up a
  743.           GAPCDR door program.
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.                                        Page 14
  761.  
  762.  
  763.  
  764.           GAP Communications                                         GAPCDR
  765.  
  766.  
  767.           Configuration
  768.  
  769.           To configure the door for a particular BBS setup, a configuration
  770.           file must  be used.  At the  very minimum, this file will contain
  771.           eight lines.  It may  contain more  than eight  depending upon  a
  772.           particular door's  configuration requirements.  The name  of  the
  773.           file is  usually the  same as that of the door program but with a
  774.           CNF extension.  The minimum  requirements for  the  file  are  as
  775.           follows:
  776.  
  777.                           c:\gap
  778.                           The Crow's Nest BBS
  779.                           IRQ
  780.                           Port Address
  781.                           Interface
  782.                           DigiBoard Window
  783.                           DigiBoard I/O Address
  784.                           DigiBoard Channel Number
  785.  
  786.  
  787.           The first  line is  the full  path to your BBS default directory.
  788.           For GAP, this is usually C:\GAP. For PCB, this is usually C:\PCB.
  789.           The second  line is  the name  of your BBS. The third line is the
  790.           IRQ that  should be used for the port, and the fourth line is the
  791.           Base Port Address. If you are just using Com 1 and Com 2, you may
  792.           enter a 0 on these two lines.
  793.  
  794.           Lines five through eight are for the Intelligent DigiBoard multi-
  795.           port Communications  Card. The  DigiBoard  routines  specifically
  796.           support the  COM/Xi series.  All four of these lines are required
  797.           even if  you are  using the  Standard Interface. Line five is the
  798.           Communications Port Interface. It must be one of the following:
  799.  
  800.                     STANDARD    DIGIBOARD   INT14/EBIOS    FOSSIL
  801.  
  802.           The Standard  interface is the one that will normally be used. If
  803.           you  are   using  a   DigiBoard  then  either  the  DigiBoard  or
  804.           Int14/EBIOS interface  may be  selected. Most sysops will use the
  805.           Int14/EBIOS interface.  All  input/output  to  the  DigiBoard  is
  806.           performed via  Interrupt 14  calls and a Device Driver (available
  807.           from DigiBoard) handles the interface between the program and the
  808.           board. The  DigiBoard interface  uses Direct  Programming. GAPCDR
  809.           talks to the board directly without the need for a Device Driver.
  810.           In order  to use  this interface,  a program  called RESETDIG.EXE
  811.           must be used in the AUTOEXEC.BAT file to reset the DigiBoard once
  812.           when the  computer is  first booted.  If you  do  not  have  this
  813.           program (it is a part of the GAP Communications BBS package) then
  814.           the Int14/EBIOS interface must be used.
  815.  
  816.  
  817.  
  818.                                        Page 15
  819.  
  820.  
  821.  
  822.           GAP Communications                                         GAPCDR
  823.  
  824.  
  825.           The Fossil  interface is  specified when a user is using a Fossil
  826.           Device Driver (either BNU or X00). The Fossil interface also uses
  827.           Interrupt 14 calls that are specific to Fossil drivers.
  828.  
  829.           If the  Interface is  set to  STANDARD or  FOSSIL, then  lines  6
  830.           through 8  will be ignored. If the Interface is INT14/EBIOS, then
  831.           lines 6 and 7 will be ignored.
  832.  
  833.           Line 6  is the  DigiBoard Memory Window, or the address the board
  834.           uses as  a  communications  area  between  itself  and  the  Host
  835.           Computer. This  line is  used only  if the  Interface is  set  to
  836.           DIGIBOARD. It  can be  set to  0 if  the Interface is STANDARD or
  837.           INT14/EBIOS.
  838.  
  839.           Line 7  is the DigiBoard I/O Port Address. This line is used only
  840.           if the  Interface is  set to  DIGIBOARD  and  can  be  set  to  0
  841.           otherwise.
  842.  
  843.           Line 8 is the DigiBoard Channel Number. This line is required for
  844.           the DIGIBOARD  and INT14/EBIOS  Interfaces. It  is normally 1 - 8
  845.           for the  DIGIBOARD Interface  and 4  -  11  for  the  INT14/EBIOS
  846.           Interface. The  Channel Number  is similar  to a  Port Number. It
  847.           tells the  program which of the DigiBoard Communications ports to
  848.           use.
  849.  
  850.           GAPCDR will obtain the sysop's name from the DOOR.SYS file.
  851.  
  852.           You must  now create  a batch file to invoke the door. This batch
  853.           file is  placed in  the directory  where you  told your BBS SetUp
  854.           program to look for it. Such a batch file might look like this:
  855.  
  856.  
  857.                           @echo off
  858.                           cd \gap\doors\tourist
  859.                           tourist tourist.cnf
  860.                           cd \gap
  861.  
  862.  
  863.           As you  can see, the door is invoked by passing the configuration
  864.           file name as  the first parameter.
  865.  
  866.           You will  also need  to modify your doors menu files and the data
  867.           file that  tells the  BBS what  your doors  are and  the security
  868.           level needed to access them. For GAP, these are respectively:
  869.  
  870.             DOORM
  871.             DOORMG
  872.             DOORS.DAT
  873.  
  874.  
  875.  
  876.                                        Page 16
  877.  
  878.  
  879.  
  880.           GAP Communications                                         GAPCDR
  881.  
  882.  
  883.  
  884.           If you  are running  multi-nodes, simply  create a  separate door
  885.           configuration file  for each node, and number them. For instance,
  886.           for a  3 node  system, you might have the following configuration
  887.           files:
  888.  
  889.             TOURIST1.CNF
  890.             TOURIST2.CNF
  891.             TOURIST3.CNF
  892.  
  893.           The only difference between the three would be the 1st line which
  894.           points to the default directory for the particular node.
  895.  
  896.           Multi-user operation  is automatic.The  DOOR.SYS file  contains a
  897.           field that specifies if the BBS is multi-user or not.
  898.  
  899.  
  900.           Sysop Functions
  901.  
  902.           The  following  sysop  functions  are  available  while  awaiting
  903.           keyboard input :
  904.  
  905.             F5              - Shell to DOS.
  906.             F8              - Twit user and return to BBS.
  907.             F10             - Initiate chat with user.
  908.             CF10            - Answer user page bell.
  909.             Home            - Main user stats.
  910.             End             - Displays sysop keys available.
  911.             PgDn            - Secondary user stats.
  912.             Up Arrow        - Increase user's time remaining.
  913.             Dn Arrow        - Decrease user's time remaining.
  914.  
  915.  
  916.           One of  the nicer  features about using the TWIT key, is the user
  917.           is not  told that  "the sysop  wants them  to return to the BBS".
  918.           Instead, a very plain and simple message of "returning you to the
  919.           BBS" is displayed. This way, the user is given no indication that
  920.           the sysop is hovering about.
  921.  
  922.           When using  the F5  shell to  DOS key,  to  return  to  the  door
  923.           program, simply  type EXIT  at the  DOS command prompt. It is not
  924.           necessary to  change directories  back  to  the  door  directory.
  925.           GAPCDR is smart enough to know which drive and directory the door
  926.           program is  in and  will reset the defaults upon return from DOS.
  927.           In addition, the status line will remain on the screen.
  928.  
  929.           It should  be noted  that when  in a DOS shell, the GAPCDR status
  930.           line is  protected by  intercepting BIOS  video calls. If you use
  931.  
  932.  
  933.  
  934.                                        Page 17
  935.  
  936.  
  937.  
  938.           GAP Communications                                         GAPCDR
  939.  
  940.  
  941.           ANSI.SYS replacements which write directly to the video, you will
  942.           not have this protection and your status line will scroll off the
  943.           screen
  944.  
  945.           The Up  and Down Arrow keys increase and decrease the user's time
  946.           respectively by  5 minutes for each press of the key. There is no
  947.           indication of  what is  occurring (except  by the fact the user's
  948.           time remaining  will change), so the sysop should try not to have
  949.           a lead  finger. The  increase or decrease is effective only while
  950.           the user  is in the door. Whether or not these time credits (plus
  951.           or minus)  are made  a permanent  part of the user record so that
  952.           upon return  from the  DOOR, the BBS program will recognize them,
  953.           depends upon the door author.
  954.  
  955.  
  956.  
  957.           Advanced Applications
  958.  
  959.  
  960.           GAPCDR includes a great many advanced functions which can be used
  961.           with or  without the  BBS Door  Interface (i.e., automatic status
  962.           line, time left checking, keyboard timeout checking, etc).
  963.  
  964.  
  965.           Communications
  966.  
  967.           The communications  functions are  an integral part of GAPCDR and
  968.           are called  automatically by  an output  routine if  the variable
  969.           local is  set to  0. However,  they may  be used  stand alone  or
  970.           called directly  if necessary.  These routines  are  fully  self-
  971.           contained with the exception of 3 global variables and 3 external
  972.           functions.
  973.  
  974.           The global variables are:
  975.  
  976.             baud            - Port speed
  977.             gotdv           - Flag signalling the presense of DESQview
  978.             port            - Communications Port Number
  979.  
  980.  
  981.           The external functions are:
  982.  
  983.             no_carrier      - Called if carrier is dropped
  984.             timer           - Time delay routine
  985.             dv_pause        - Called to give up time slice
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.                                        Page 18
  993.  
  994.  
  995.  
  996.           GAP Communications                                         GAPCDR
  997.  
  998.  
  999.           Before  using   the  communications   routines  as   stand  alone
  1000.           functions, you  should make  a call to dv_here so that it can set
  1001.           the gotdv  flag. If  you are  not concerned about the presense of
  1002.           DESQview, you must declare this variable and initialize it to 0:
  1003.  
  1004.             short near gotdv = 0;
  1005.  
  1006.           Note that it must be declared such that it resides in the default
  1007.           data segment.  If you  declare the  variable yourself,  you  must
  1008.           insure that  the DESQVIEW.ASM  module is  not linked  in to  your
  1009.           program. You will need to create a dummy function called dv_pause
  1010.           that does  nothing but  return. This is necessary because even if
  1011.           you do  not wish  to use  the dv_pause  function, the linker will
  1012.           complain if it cannot find it:
  1013.  
  1014.             void _pascal dv_pause(void);
  1015.  
  1016.           Next, you  must set the variable port to the port number you will
  1017.           be using.  Ports start  at 0, where COM 1 equals Port 0. Then set
  1018.           the variable baud to the bps rate you want the port opened at.
  1019.  
  1020.           Your program  will need  to include a function called no_carrier.
  1021.           It is prototyped as:
  1022.  
  1023.             void _pascal no_carrier(void);
  1024.  
  1025.           This function  is called by the communications routines when they
  1026.           detect that  there is  no carrier.  You may  do whatever you wish
  1027.           inside this function but keep in mind that it will continue to be
  1028.           called if  there is no carrier on the port. You most certainly do
  1029.           not want  to make  calls to  any of  the communications functions
  1030.           from inside  this routine  or a  stack overflow  will  eventually
  1031.           result. If  you wish  to do  your own  carrier detecting  (as you
  1032.           would if  you were  going to be using these functions to create a
  1033.           dial out  type of program), then this function can simply contain
  1034.           a return.
  1035.  
  1036.           Once you  have the global variables configured, the first step in
  1037.           initializing the  serial port  is to  make  a  call  to  setport.
  1038.           Setport creates  the receive  buffer and  then sets up the serial
  1039.           port.  After  the  port  is  configured,  you  should  then  call
  1040.           init_port to  set the  baud, parity,  and  data  bits.  Init_port
  1041.           supports all  the baud  rates that  a UART  on  an  IBM  type  of
  1042.           computer is  capable of  utilizing. After  this the port is fully
  1043.           configured and may now be utilized. Before your program ends, you
  1044.           must call reset_port to restore the interrupt vector back the way
  1045.           it was.
  1046.  
  1047.  
  1048.  
  1049.  
  1050.                                        Page 19
  1051.  
  1052.  
  1053.  
  1054.           GAP Communications                                         GAPCDR
  1055.  
  1056.  
  1057.           The main input routines are:
  1058.  
  1059.             comgetc         - Get a single character from the port
  1060.             comgetd         - Get a character with timeout
  1061.  
  1062.  
  1063.           The main output routines are:
  1064.  
  1065.             computc         - Send a single character
  1066.             computs         - Send a string
  1067.  
  1068.  
  1069.           There are  routines for checking carrier, turning DTR on and off,
  1070.           checking if  there are  any characters in the receive buffer, and
  1071.           clearing the receive buffer.
  1072.  
  1073.           If you  need to change baud rates simple set the variable baud to
  1074.           whatever bps rate you want to change to and then call init_port.
  1075.  
  1076.  
  1077.           DOS Window
  1078.  
  1079.           GAPCDR includes  some very advanced functions for setting up what
  1080.           we call  a DOS  Window. This  is a  Window that you define on the
  1081.           local screen  and to which all DOS output will be redirected. For
  1082.           instance, if  you needed  to shell  to DOS to run PKUNZIP or DSZ,
  1083.           you could  set up  a DOS  Window and  all output  from these  two
  1084.           programs will be contained inside the window. The window can also
  1085.           be used  without shelling  to DOS  although there  is  really  no
  1086.           practical use for doing so.
  1087.  
  1088.           To set  up a  DOS window, the first thing you should do is make a
  1089.           call to  get_attr so that the current screen colors can be stored
  1090.           away. This  is necessary  because you  may want  to  use  special
  1091.           colors in  your  DOS  window.  By  storing  the  original  screen
  1092.           attributes, they  can be  restored when  you  close  the  window,
  1093.           thereby keeping  the user's  screen colors the way the user likes
  1094.           them!
  1095.  
  1096.           At the  beginning of  your program  call get_attr. Do this before
  1097.           you do any screen output. You will then make several calls to the
  1098.           various GAPCDR  functions to  setup your  DOS window.  Once it is
  1099.           configured, you  can then  shell to DOS and do whatever you like.
  1100.           All screen  output will take place inside the window. Please note
  1101.           that if  you use a console driver other than CON or ANSI.SYS (and
  1102.           this generally  includes all  so called video speed up programs),
  1103.           or run  a program that writes directly to the screen, then output
  1104.           will not  take place  inside of the window. This is because video
  1105.  
  1106.  
  1107.  
  1108.                                        Page 20
  1109.  
  1110.  
  1111.  
  1112.           GAP Communications                                         GAPCDR
  1113.  
  1114.  
  1115.           speed up  programs generally write directly to the screen instead
  1116.           of using the BIOS.
  1117.  
  1118.           To see  how the  DOS window works, after setting it up, issue the
  1119.           following call:
  1120.  
  1121.             system("COMMAND");
  1122.  
  1123.           This will  put you  in a  DOS shell. You may then execute various
  1124.           DOS functions  and get  a feel for what it looks like. Be sure to
  1125.           type "exit" to return to your program.
  1126.  
  1127.           When you no longer need the DOS window, it is imperitive that you
  1128.           remove the  interrupt 10 (BIOS) intercepter or your computer will
  1129.           hang when you exit the program.
  1130.  
  1131.           There is  a fully  working example  of a  DOS Window in the CDOOR
  1132.           example program.  It shows  how to  save a portion of the screen,
  1133.           draw a box, set up the interrupt 10 intercepter and shell to DOS.
  1134.           Upon return from the shell, it will remove the DOS Window.
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.                                        Page 21
  1167.  
  1168.  
  1169.  
  1170.           GAP Communications                                         GAPCDR
  1171.  
  1172.  
  1173.           Variables
  1174.  
  1175.  
  1176.  
  1177.           Defines
  1178.  
  1179.           The following defines are used when calling show_mess.
  1180.  
  1181.             NO           - Defined as 0
  1182.             YES          - Defined as 1
  1183.  
  1184.           Ansi Variables
  1185.  
  1186.           ANSI strings contain the actual ANSI color sequences.
  1187.  
  1188.             A_BLACK      - ANSI codes for Black
  1189.             A_BLUE       - ANSI codes for Blue
  1190.             A_BROWN      - ANSI codes for Brown
  1191.             A_CYAN       - ANSI codes for Cyan
  1192.             A_GREEN      - ANSI codes for Green
  1193.             A_MAGENTA    - ANSI codes for Magenta
  1194.             A_RED        - ANSI codes for Red
  1195.             A_WHITE      - ANSI codes for White
  1196.  
  1197.  
  1198.             A_BBLACK     - ANSI codes for Grey
  1199.             A_BBLUE      - ANSI codes for bright Blue
  1200.             A_BCYAN      - ANSI codes for bright Cyan
  1201.             A_BGREEN     - ANSI codes for bright Green
  1202.             A_BMAGENTA   - ANSI codes for bright Magenta
  1203.             A_BRED       - ANSI codes for bright Red
  1204.             A_BWHITE     - ANSI codes for bright White
  1205.             A_YELLOW     - ANSI codes for Yellow
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.                                        Page 22
  1225.  
  1226.  
  1227.  
  1228.           GAP Communications                                         GAPCDR
  1229.  
  1230.  
  1231.           DOOR.SYS Variables
  1232.  
  1233.           DOOR.SYS variables  are initialized  while reading  the  DOOR.SYS
  1234.           file. These variables are the door programmer's connection to the
  1235.           BBS.
  1236.  
  1237.  
  1238.           Short Integers
  1239.  
  1240.             alarm        - 0 = caller alarm off, 1 = on
  1241.             baud         - DTE bps rate (unsigned)
  1242.             bell         - 0 = page bell off, 1 = bell on
  1243.             color        - 0 = no color, 1 = color
  1244.             curfiles     - current files downloaded
  1245.             dflt_color   - BBS default color
  1246.             digiseg      - DigiBoard Memory Window
  1247.             digiport     - DigiBoard I/O Port
  1248.             digichnl     - DigiBoard Channel #
  1249.             expert       - 0 = novice, 1 = expert
  1250.             interface    - 0 = Standard, 1 = DigiBoard, 2 = INT14/EBIOS
  1251.             level        - user's security level
  1252.             local        - 0 = remote user, 1 = local user
  1253.             maxfiles     - max files available
  1254.             minsleft     - minutes left at door start
  1255.             multi        - 1 = system is multi-user
  1256.             node         - node number in use, 0 = single
  1257.             page         - page length
  1258.             parity       - actually data bits, not used
  1259.             port         - com port being used
  1260.             printer      - 0 = printer off, 1 = printer on
  1261.             realcredit   - time credits from the BBS
  1262.             screen       - 0 = screen off, 1 = screen on
  1263.             userbaud     - remote user's bps rate (unsigned)
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.                                        Page 23
  1283.  
  1284.  
  1285.  
  1286.           GAP Communications                                         GAPCDR
  1287.  
  1288.  
  1289.           Long Integers
  1290.  
  1291.             curbytes     - current download bytes
  1292.             doors_open   - total doors opened
  1293.             downbytes    - total download bytes
  1294.             downloads    - total number of downloads
  1295.             maxbytes     - max bytes can download
  1296.             mesleft      - total messages left
  1297.             recnum       - user's record number
  1298.             timeson      - # of times on
  1299.             upbytes      - total upload bytes
  1300.             uploads      - total number of uploads
  1301.  
  1302.           Character Arrays
  1303.  
  1304.             bphone       - user's business phone number
  1305.             city         - user's home town
  1306.             event_time   - event run time
  1307.             fname        - user's first name
  1308.             handle       - caller's Handle
  1309.             hphone       - user's home phone number
  1310.             last_new     - last new files scan
  1311.             lastdate     - last date user was on
  1312.             lname        - user's last name
  1313.             password     - user's password
  1314.             subscrip     - date user's subscription expires
  1315.             username     - user's full name
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.                                        Page 24
  1341.  
  1342.  
  1343.  
  1344.           GAP Communications                                         GAPCDR
  1345.  
  1346.  
  1347.           Global Variables
  1348.  
  1349.           These variables are the documented, global variables (initialized
  1350.           and used  by GAPCDR).  They may  be modified  and/or used  at the
  1351.           programmer's discretion.
  1352.  
  1353.  
  1354.           Characters
  1355.  
  1356.             chat         - true if chatting with user
  1357.             clockon      - 0 no clock, 1 display clock
  1358.             column       - column we are at now
  1359.             endview      - true if dont want to viewany more
  1360.             flag         - flag that a space was pressed
  1361.             instatus     - if doing status line
  1362.             noup         - if 1, dont uppercase characters
  1363.             NS           - true if in Non Stop mode
  1364.             redisplay    - true if wants to start over
  1365.             usemore1     - true if showing a file
  1366.             view         - true to use the more prompt
  1367.             wordwrap     - column to wrap words at
  1368.  
  1369.           Short Integers
  1370.  
  1371.             base_add     - base address for port
  1372.             irq          - IRQ for port
  1373.             lines        - # of lines currently displayed
  1374.             normal       - current display color
  1375.             timecredit   - any time credits user may have
  1376.             timeleft     - time user has left
  1377.  
  1378.           Long Integers
  1379.  
  1380.             starttime    - time door opened
  1381.             temptime     - for calculating time out
  1382.             timenow      - current time
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.                                        Page 25
  1399.  
  1400.  
  1401.  
  1402.           GAP Communications                                         GAPCDR
  1403.  
  1404.  
  1405.           Character Arrays
  1406.  
  1407.             anystring    - global garbage collector
  1408.             bbs_dir      - path to DOOR.SYS
  1409.             birthday     - caller's birth date
  1410.             board_name   - name of the BBS
  1411.             BS           - backspace characters
  1412.             CRLF         - carriage return/line feed characters
  1413.             curtime      - holds the current time as a string
  1414.             gendir       - path to the BBS gen dir
  1415.             maindir      - path to the BBS main dir
  1416.             strtime      - holds the time string
  1417.             sysname      - sysop's name
  1418.  
  1419.           Structures
  1420.  
  1421.             GAP_USER user     - GAP's User Record
  1422.             PCBSYS pcbsys     - PCB's System Record
  1423.             PCBUSER pcbuser   - PCB's User Record
  1424.  
  1425.  
  1426.           These structures are fully commented in the GAPCDR.H header file.
  1427.           Note that  when utilizing  the GAP  user  structure,  all  string
  1428.           fields are fully padded with spaces and the last position must be
  1429.           a 0.
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.                                        Page 26
  1457.  
  1458.  
  1459.  
  1460.           GAP Communications                                         GAPCDR
  1461.  
  1462.  
  1463.           Functions - Quick Reference
  1464.  
  1465.  
  1466.             access1         - Checks for the existence of a file.
  1467.             ansi            - Displays ANSI color strings.
  1468.             backspace       - Sends one or more backspaces.
  1469.             ckeypress       - Checks for a remote or local key press.
  1470.             clear_scrn      - Clears the local and remote screens.
  1471.             clr_buf         - Cleare the communications receive buffer.
  1472.             cls             - Clears the 1st 23 lines on the local screen.
  1473.             cls_all         - Clears the entire local screen.
  1474.             comgetc         - Gets a character from com port.
  1475.             comgetd         - Geta a character from com port with timeout.
  1476.             computb         - Sends a buffer of data to com port.
  1477.             computc         - Sends a character to com port.
  1478.             computs         - Sends a string to com port.
  1479.             cursoff         - Turns local cursor off.
  1480.             curson          - Turns local cursor on.
  1481.             do_chat         - To allow sysop to chat with remote user.
  1482.             dtr             - Toggels the DTR line on or off.
  1483.             dv_here         - Checks for the presense of DESQView.
  1484.             dv_pause        - Gives up remainder of time slice to DV.
  1485.             elap_time       - Computes elapsed time.
  1486.             empty           - Empties a string.
  1487.             fix_color       - Modifies ANSI driver for color or mono.
  1488.             gapputc         - Sends a character to local and remote.
  1489.             gapputs         - Sends a string to local and remote screens.
  1490.             getakey         - Gets one key responses.
  1491.             getkeyc         - Gets keyboard character and scan code.
  1492.             get_attr        - Gets startup video attribute.
  1493.             get_random      - Returns a random number.
  1494.             get_string      - Gets a string of characters.
  1495.             init_ansi       - Initializes ANSI driver.
  1496.             init_com        - Initializes Communications Port.
  1497.             init_door       - Initializes the Door.
  1498.             init_port       - Sets up Communications Port.
  1499.             iscd            - Checks if there is a Carrier.
  1500.             leave           - Shuts down door and returns to the BBS.
  1501.             lputc           - Sends a character to local screen.
  1502.             lputs           - Sends a string to local screen.
  1503.             make_sound      - Makes noise on local computer.
  1504.             more            - Checks for a full screen.
  1505.             nl              - Sends a CR/LF to local and remote.
  1506.             no_carrier      - Called by the Comm Routines if Carrier lost.
  1507.             pagesysop       - Alerts sysop that the user wants to chat.
  1508.             pause           - Sends a "Press [Any Key] To Continue" prompt.
  1509.             putkey          - Used by chat for word wrapping.
  1510.             read_cnf        - Reads the door configuration file.
  1511.  
  1512.  
  1513.  
  1514.                                        Page 27
  1515.  
  1516.  
  1517.  
  1518.           GAP Communications                                         GAPCDR
  1519.  
  1520.  
  1521.             read_doorsys    - Reads DOOR.SYS.
  1522.             read_gapuser    - Reads USERS.DAT.
  1523.             read_pcbsys     - Reads PCBOARD.SYS.
  1524.             read_pcbuser    - Reads PCB USERS file.
  1525.             read_score      - Reads and displays top 10 scores.
  1526.             reset_port      - Restores Communications Port.
  1527.             restore_screen  - Restores a portion of the screen.
  1528.             rest_cbreak     - Restores Ctrl-Break vector.
  1529.             rest_int10      - Restores BIOS vector.
  1530.             rts             - Toggels RTS line on or off.
  1531.             rxempty         - Checks if any characters in receive buffer.
  1532.             save_screen     - Saves a portion of the screen.
  1533.             setport         - Initializes Communications port.
  1534.             set_attr        - Sets video attributes.
  1535.             set_cbreak      - Initializes Ctrl-Break vector.
  1536.             set_cord        - Sets up a DOS Window.
  1537.             set_int10       - Initializes BIOS trapper.
  1538.             set_status      - Displays status line.
  1539.             show_file       - Displays text files.
  1540.             show_mess       - Displays a message.
  1541.             timer           - Time Delay.
  1542.             time_credit     - Gives credits for time used.
  1543.             time_left       - Computes time remaining.
  1544.             trim            - Trims spaces from string.
  1545.             update_clock    - Updates status line clock.
  1546.             wrap_word       - Wraps a word.
  1547.             write_gapuser   - Writes USERS.DAT.
  1548.             write_pcbsys    - Writes PCBOARD.SYS.
  1549.             write_pcbuser   - Writes PCB USERS.
  1550.             write_score     - Creates and maintains top 10 scores file.
  1551.  
  1552.  
  1553.           Functions - Detailed Reference
  1554.  
  1555.  
  1556.           Functions will  return either a void (nothing), a short value, or
  1557.           a character pointer.
  1558.  
  1559.           The function  descriptions will note whether or not a function is
  1560.           high level  or low  level. The high level functions are basically
  1561.           the only  functions you  will ever  need to  use. When necessary,
  1562.           they will  call other  functions to carry out their work. The low
  1563.           level functions,  on the other hand, are more single purpose, and
  1564.           they generally  require calls  to other  low level  functions  to
  1565.           perform the same task as one call to a high level function.
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.                                        Page 28
  1573.  
  1574.  
  1575.  
  1576.           GAP Communications                                         GAPCDR
  1577.  
  1578.  
  1579.           access1
  1580.           -----------------------------------------------------------------
  1581.  
  1582.           Purpose       Checks for the existence of a file.
  1583.  
  1584.                         short access1(char *filename);
  1585.  
  1586.                         filename   Full path and name of file
  1587.  
  1588.           Type          High Level
  1589.  
  1590.           Description   This function is used to check for the existence of
  1591.                         a file. It works in a multi-user environment and is
  1592.                         not affected by file sharing attributes.
  1593.  
  1594.           Return Value  0 = File exists, 1 = File not found.
  1595.  
  1596.           Example
  1597.  
  1598.              if ((access1("FILE.DAT")))
  1599.                show_mess("Sorry, File does not Exist!", YES,YES);
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.                                        Page 29
  1631.  
  1632.  
  1633.  
  1634.           GAP Communications                                         GAPCDR
  1635.  
  1636.  
  1637.           ansi
  1638.           -----------------------------------------------------------------
  1639.  
  1640.           Purpose       Displays ANSI color sequences.
  1641.  
  1642.                         void ansi(char *color);
  1643.  
  1644.                         color      Ansi color string
  1645.  
  1646.           Type          High Level
  1647.  
  1648.           Description   This function  will send  a string  of ANSI  escape
  1649.                         sequences to  the remote  user  and  to  the  local
  1650.                         console. The  ANSI codes for the various colors are
  1651.                         declared as  global variables.  If  the  remote  or
  1652.                         local user  is in  non graphics  mode, the function
  1653.                         returns immediately.
  1654.  
  1655.           Return Value  None.
  1656.  
  1657.           Example       ansi(A_BWHITE);   // Change color to bright white
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.                                        Page 30
  1689.  
  1690.  
  1691.  
  1692.           GAP Communications                                         GAPCDR
  1693.  
  1694.  
  1695.           backspace
  1696.           -----------------------------------------------------------------
  1697.  
  1698.           Purpose       Sends one or more backspaces.
  1699.  
  1700.                         void backspace(short num);
  1701.  
  1702.                         num        Number of backspaces to send
  1703.  
  1704.           Type          High Level
  1705.  
  1706.           Description   In order  to actually  erase  a  character  on  the
  1707.                         screen, you  must send a 3 character sequence which
  1708.                         consists  of   backspace,  space,  backspace.  This
  1709.                         function will  send as  many of  these 3  character
  1710.                         sequences as you specify in the parameter list.
  1711.  
  1712.           Return Value  None.
  1713.  
  1714.           Example       backspace(1);     // erase last character sent
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746.                                        Page 31
  1747.  
  1748.  
  1749.  
  1750.           GAP Communications                                         GAPCDR
  1751.  
  1752.  
  1753.           ckeypress
  1754.           -----------------------------------------------------------------
  1755.  
  1756.           Purpose       Checks for a remote or local key press.
  1757.  
  1758.                         short ckeypress(void);
  1759.  
  1760.           Type          High Level
  1761.  
  1762.           Description   This function will check the local keyboard as well
  1763.                         as the  communications receive  buffer to  see if a
  1764.                         key is waiting to be read. It is most often used in
  1765.                         loops   that   monitor   keyboard   timeout,   time
  1766.                         remaining, etc.
  1767.  
  1768.           Return Value  0 = no key is waiting, 1 = a key is waiting.
  1769.  
  1770.           Example       c = ckeypress();  // key pressed?
  1771.  
  1772.              while(!ckeypress())          // do nothing
  1773.                {     // until a key is pressed
  1774.                dv_pause()                 // give up time slice
  1775.                }
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799.  
  1800.  
  1801.  
  1802.  
  1803.  
  1804.                                        Page 32
  1805.  
  1806.  
  1807.  
  1808.           GAP Communications                                         GAPCDR
  1809.  
  1810.  
  1811.           clear_scrn
  1812.           -----------------------------------------------------------------
  1813.  
  1814.           Purpose       Clears local and remote screens.
  1815.  
  1816.                         void clear_scrn(void);
  1817.  
  1818.           Type          High Level
  1819.  
  1820.           Description   This routine  will use the assembler routine cls to
  1821.                         clear the  first 23  lines of  the local screen. If
  1822.                         the remote  caller is in non-color mode, it sends a
  1823.                         CTRL-L to the remote screen, otherwise it sends the
  1824.                         ANSI clear screen sequence.
  1825.  
  1826.           Return Value  None.
  1827.  
  1828.           Example       clear_scrn();     // clear screen
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.  
  1861.  
  1862.                                        Page 33
  1863.  
  1864.  
  1865.  
  1866.           GAP Communications                                         GAPCDR
  1867.  
  1868.  
  1869.           clr_buf
  1870.           -----------------------------------------------------------------
  1871.  
  1872.           Purpose       Clears the Communications receive buffer.
  1873.  
  1874.                         void clr_buf(void);
  1875.  
  1876.           Type          Low Level
  1877.  
  1878.           Description   Empties the  receive buffer  such that  any pending
  1879.                         characters are simply ignored.
  1880.  
  1881.           Return Value  None.
  1882.  
  1883.           Example       clr_buf();      // clear the receive buffer
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.                                        Page 34
  1921.  
  1922.  
  1923.  
  1924.           GAP Communications                                         GAPCDR
  1925.  
  1926.  
  1927.           cls
  1928.           -----------------------------------------------------------------
  1929.  
  1930.           Purpose       Clears the first 23 lines on the local screen.
  1931.  
  1932.                         void cls(void);
  1933.  
  1934.           Type          Low Level
  1935.  
  1936.           Description   This function  will clear the first 23 lines on the
  1937.                         local  screen,  thereby  protecting  the  bottom  2
  1938.                         lines.
  1939.  
  1940.           Return Value  None.
  1941.  
  1942.           Example       cls();          // clear 1st 23 lines
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.                                        Page 35
  1979.  
  1980.  
  1981.  
  1982.           GAP Communications                                         GAPCDR
  1983.  
  1984.  
  1985.           cls_all
  1986.           -----------------------------------------------------------------
  1987.  
  1988.           Purpose       Clears the entire local screen.
  1989.  
  1990.                         void cls_all(void);
  1991.  
  1992.           Type          Low Level
  1993.  
  1994.           Description   This function  will clear  the entire local screen.
  1995.                         It is used by leave to tidy up the screen.
  1996.  
  1997.           Return Value  None.
  1998.  
  1999.           Example       cls_all();      // clear entire screen
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.                                        Page 36
  2037.  
  2038.  
  2039.  
  2040.           GAP Communications                                         GAPCDR
  2041.  
  2042.  
  2043.           comgetc
  2044.           -----------------------------------------------------------------
  2045.  
  2046.           Purpose       Retrieve a character from communications buffer.
  2047.  
  2048.                         short comgetc(void);
  2049.  
  2050.           Type          Low Level
  2051.  
  2052.           Description   Checks  the   communications  receive   buffer  and
  2053.                         returns the next character, if any.
  2054.  
  2055.           Return Value  Next character in buffer or -1 for no characters to
  2056.                         read.
  2057.  
  2058.           Example       c = comgetc();    // get a character from remote
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.                                        Page 37
  2095.  
  2096.  
  2097.  
  2098.           GAP Communications                                         GAPCDR
  2099.  
  2100.  
  2101.           comgetd
  2102.           -----------------------------------------------------------------
  2103.  
  2104.           Purpose       Retrieve a  character  from  comminications  buffer
  2105.                         with delay.
  2106.  
  2107.                         short comgetd(short secs);
  2108.  
  2109.                         secs       Number of seconds to wait
  2110.  
  2111.           Type          Low level
  2112.  
  2113.           Description   This function  is the  same as comgetc, except that
  2114.                         if there  are no  characters in the receive buffer,
  2115.                         it will wait for the number of seconds you specify.
  2116.                         Comgetd is  fully DESQview  aware and  will give up
  2117.                         the program's time slice while waiting for incoming
  2118.                         characters.
  2119.  
  2120.           Return Value  Next character  in buffer  or -10  for time-out (no
  2121.                         characters to read).
  2122.  
  2123.           Example
  2124.  
  2125.              if ( (comgetd(2)) == -10)    // wait for 2 seconds
  2126.                ;     // nothing happening
  2127.  
  2128.  
  2129.  
  2130.  
  2131.  
  2132.  
  2133.  
  2134.  
  2135.  
  2136.  
  2137.  
  2138.  
  2139.  
  2140.  
  2141.  
  2142.  
  2143.  
  2144.  
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151.  
  2152.                                        Page 38
  2153.  
  2154.  
  2155.  
  2156.           GAP Communications                                         GAPCDR
  2157.  
  2158.  
  2159.           computb
  2160.           -----------------------------------------------------------------
  2161.  
  2162.           Purpose       Sends a buffer of data out the communications port.
  2163.  
  2164.                         void computb(char *buffer,short len);
  2165.  
  2166.                         buffer     Buffer containing data to send
  2167.                         len        Number of bytes to send
  2168.  
  2169.           Type          Low Level
  2170.  
  2171.           Descripton    This function  will send  a user  suplied buffer of
  2172.                         len bytes  out the communications port, one byte at
  2173.                         a time.  It will  not return  until all  characters
  2174.                         have been sent.
  2175.  
  2176.           Return Value  None.
  2177.  
  2178.           Example       computb(buffer,100);      // Send 100 bytes of data
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.  
  2187.  
  2188.  
  2189.  
  2190.  
  2191.  
  2192.  
  2193.  
  2194.  
  2195.  
  2196.  
  2197.  
  2198.  
  2199.  
  2200.  
  2201.  
  2202.  
  2203.  
  2204.  
  2205.  
  2206.  
  2207.  
  2208.  
  2209.  
  2210.                                        Page 39
  2211.  
  2212.  
  2213.  
  2214.           GAP Communications                                         GAPCDR
  2215.  
  2216.  
  2217.           computc
  2218.           -----------------------------------------------------------------
  2219.  
  2220.           Purpose       Sends a  single character  out  the  communications
  2221.                         port.
  2222.  
  2223.                         void computc(unsigned char ch);
  2224.  
  2225.                         ch         Character to send
  2226.  
  2227.           Type          Low Level
  2228.  
  2229.           Description   Will send a single character out the communications
  2230.                         port.
  2231.  
  2232.           Return Value  None.
  2233.  
  2234.           Example       computc('A');     // Send a character
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.  
  2253.  
  2254.  
  2255.  
  2256.  
  2257.  
  2258.  
  2259.  
  2260.  
  2261.  
  2262.  
  2263.  
  2264.  
  2265.  
  2266.  
  2267.  
  2268.                                        Page 40
  2269.  
  2270.  
  2271.  
  2272.           GAP Communications                                         GAPCDR
  2273.  
  2274.  
  2275.           computs
  2276.           -----------------------------------------------------------------
  2277.  
  2278.           Purpose       Sends a string of characters out the communications
  2279.                         port.
  2280.  
  2281.                         void computs(char *str);
  2282.  
  2283.                         str        String to send
  2284.  
  2285.           Type          Low Level
  2286.  
  2287.           Description   Will  send   a  string   of  characters   out   the
  2288.                         communications port.  Note that unlike computb, the
  2289.                         number of bytes to send is determined by the length
  2290.                         of  the   string.  Therefore  this  function  stops
  2291.                         sending characters  when  it  encounters  the  null
  2292.                         byte.
  2293.  
  2294.           Return Value  None.
  2295.  
  2296.           Example       computs("Send this string");   // send a string
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320.  
  2321.  
  2322.  
  2323.  
  2324.  
  2325.  
  2326.                                        Page 41
  2327.  
  2328.  
  2329.  
  2330.           GAP Communications                                         GAPCDR
  2331.  
  2332.  
  2333.           cursoff
  2334.           -----------------------------------------------------------------
  2335.  
  2336.           Purpose       Turns the local cursor off.
  2337.  
  2338.                         void cursoff(void);
  2339.  
  2340.           Type          Low Level
  2341.  
  2342.           Description   This function  is used  to turn  the cursor  on the
  2343.                         local monitor off.
  2344.  
  2345.           Return Value  None.
  2346.  
  2347.           Example       cursoff();      // turn the cursor off
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.           curson
  2354.           -----------------------------------------------------------------
  2355.  
  2356.           Purpose       Turns the local cursor on.
  2357.  
  2358.                         void curson(void);
  2359.  
  2360.           Type          Low Level
  2361.  
  2362.           Description   This function  is used  to turn  the cursor  on the
  2363.                         local monitor on.
  2364.  
  2365.           Return Value  None.
  2366.  
  2367.           Example       curson();       // turn the cursor on
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.                                        Page 42
  2385.  
  2386.  
  2387.  
  2388.           GAP Communications                                         GAPCDR
  2389.  
  2390.  
  2391.           do_chat
  2392.           -----------------------------------------------------------------
  2393.  
  2394.           Purpose       To allow sysop to chat with remote user.
  2395.  
  2396.                         void do_chat(void);
  2397.  
  2398.           Type          High Level
  2399.  
  2400.           Description   This function  allows a  one on one chat with a re-
  2401.                         mote user.  If the  caller is in graphics mode, the
  2402.                         sysop's key  presses will be displayed in green and
  2403.                         the remote  user's key presses will be displayed in
  2404.                         white. Text  will automatically  wrap at column 76.
  2405.                         To exit  chat, press  either the  ESC key or type a
  2406.                         CTRL-X. Note  that the  user may  also  send  these
  2407.                         characters to  end chat. The user will receive full
  2408.                         credit for  the time spent chatting with the sysop.
  2409.                         However, this  function will  not  update  the  BBS
  2410.                         system file  so it is possible that the user may be
  2411.                         logged off  (with an  out  of  time  message)  when
  2412.                         he/she returns to the BBS.
  2413.  
  2414.           Return Value  None.
  2415.  
  2416.           Example       do_chat();        // chat with caller
  2417.  
  2418.              empty(response,1);           // initialize string
  2419.  
  2420.              get_string(response);        // get a string
  2421.  
  2422.              if (response[0] == 'P')      // paging sysop
  2423.                do_chat();                 // chat with sysop
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.                                        Page 43
  2443.  
  2444.  
  2445.  
  2446.           GAP Communications                                         GAPCDR
  2447.  
  2448.  
  2449.           dtr
  2450.           -----------------------------------------------------------------
  2451.  
  2452.           Purpose       Toggle the DTR line on and off.
  2453.  
  2454.                         void dtr(short how)
  2455.  
  2456.                         how        0 = Turn DTR off.
  2457.                                    1 = Turn DTR on
  2458.  
  2459.           Type          Low Level
  2460.  
  2461.           Description   This routine  is used  to turn  the DTR line of the
  2462.                         communications port  on or  off.  Turning  DTR  off
  2463.                         while there  is a  carrier will  cause the modem to
  2464.                         drop carrier on the remote caller. In order to send
  2465.                         commands to the modem, DTR needs to be on.
  2466.  
  2467.           Return Value  None.
  2468.  
  2469.           Example
  2470.  
  2471.              dtr(1);   // turn DTR on
  2472.              computs("ATZ");                      // reset the modem
  2473.  
  2474.  
  2475.  
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.                                        Page 44
  2501.  
  2502.  
  2503.  
  2504.           GAP Communications                                         GAPCDR
  2505.  
  2506.  
  2507.           dv_here
  2508.           -----------------------------------------------------------------
  2509.  
  2510.           Purpose       Checks to  see if  the  program  is  running  under
  2511.                         DESQview.
  2512.  
  2513.                         short dv_here(void);
  2514.  
  2515.           Type          Low Level
  2516.  
  2517.           Description   This function  should generally  be called  when  a
  2518.                         program first  starts (before  any screen output is
  2519.                         performed). It  makes a  special DOS call to see if
  2520.                         DESQview is  installed. If  so, it sets an internal
  2521.                         flag indicating  the presense of DV. If the program
  2522.                         is detected  to be  running under DESQview then all
  2523.                         "do nothing"  loops (those  loops that  are looking
  2524.                         for something  to do  but because  they are waiting
  2525.                         for keyboard  or com input, are basically taking up
  2526.                         computer time  doing nothing),  will  give  up  the
  2527.                         remainder of their time slice after they figure out
  2528.                         there is  nothing for  them  to  do.  In  addition,
  2529.                         because the built in ANSI driver writes directly to
  2530.                         the screen, if DESQview is present, the driver will
  2531.                         instead write  to DV's  video shadow  buffer.  This
  2532.                         function is automatically called by init_door so it
  2533.                         is not necessary to call it again.
  2534.  
  2535.           Return Value  DESQview version number or 0 for not installed.
  2536.  
  2537.           Example
  2538.  
  2539.              if ( (dv_here()))
  2540.                show_mess("We are running under DESQview!", NO,YES);
  2541.  
  2542.  
  2543.  
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.                                        Page 45
  2559.  
  2560.  
  2561.  
  2562.           GAP Communications                                         GAPCDR
  2563.  
  2564.  
  2565.           dv_pause
  2566.           -----------------------------------------------------------------
  2567.  
  2568.           Purpose       Give up remainder of time slice to DESQview.
  2569.  
  2570.                         void dv_pause(void);
  2571.  
  2572.           Type          Low Level
  2573.  
  2574.           Description   If DESQview is installed, this function will make a
  2575.                         call to  DV such that DV will immediately switch to
  2576.                         another task.  Note that  dv_here must be called at
  2577.                         the beginning  of the  program  since  it  sets  an
  2578.                         internal variable  that this function checks to see
  2579.                         if DESQview is running.
  2580.  
  2581.                         You should  use this  function inside  of  all  "do
  2582.                         nothing" loops.
  2583.  
  2584.           Return Value  None.
  2585.  
  2586.           Example
  2587.  
  2588.              time (&temptime);            // start timer
  2589.  
  2590.              while (!getakey())           // until a key is pressed
  2591.                {
  2592.                elap_time();               // check time remaining
  2593.                dv_pause();                // give up time slice
  2594.                }
  2595.  
  2596.  
  2597.  
  2598.  
  2599.  
  2600.  
  2601.  
  2602.  
  2603.  
  2604.  
  2605.  
  2606.  
  2607.  
  2608.  
  2609.  
  2610.  
  2611.  
  2612.  
  2613.  
  2614.  
  2615.  
  2616.                                        Page 46
  2617.  
  2618.  
  2619.  
  2620.           GAP Communications                                         GAPCDR
  2621.  
  2622.  
  2623.           elap_time
  2624.           -----------------------------------------------------------------
  2625.  
  2626.           Purpose       Computes elapsed  time while  waiting for  keyboard
  2627.                         input.
  2628.  
  2629.                         void elap_time(void);
  2630.  
  2631.           Type          High Level
  2632.  
  2633.           Description   This function  is used  in loops  that await a key-
  2634.                         board response.  Prior to  entering the  loop,  the
  2635.                         variable called temptime should be initialized with
  2636.                         the  current  time.  Once  inside  the  loop,  this
  2637.                         function should  be called  to keep  track  of  the
  2638.                         elapsed time.  If there  is  no  keyboard  response
  2639.                         within 4 minutes, the user will be logged off.
  2640.  
  2641.           Return Value  None.
  2642.  
  2643.           Example
  2644.  
  2645.              time (&temptime);            // start timer
  2646.  
  2647.              while (!getakey())           // until a key is pressed
  2648.                {
  2649.                elap_time();               // check time remaining
  2650.                dv_pause();                // give up time slice
  2651.                }
  2652.  
  2653.  
  2654.  
  2655.  
  2656.  
  2657.  
  2658.  
  2659.  
  2660.  
  2661.  
  2662.  
  2663.  
  2664.  
  2665.  
  2666.  
  2667.  
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.  
  2674.                                        Page 47
  2675.  
  2676.  
  2677.  
  2678.           GAP Communications                                         GAPCDR
  2679.  
  2680.  
  2681.           empty
  2682.           -----------------------------------------------------------------
  2683.  
  2684.           Purpose       Empties a string to all spaces.
  2685.  
  2686.                         void empty(char *str,short len);
  2687.  
  2688.                         str        The string to be emptied
  2689.                         len        Number of bytes to clear
  2690.  
  2691.           Type          High Level
  2692.  
  2693.           Description   Before using  the string input routine, get_string,
  2694.                         the string  must first  be cleared  to the  maximum
  2695.                         number of  bytes allowed  to be input. Empty clears
  2696.                         the string  to all  spaces and  adds a null byte at
  2697.                         the end.  The null  byte is  not counted in the len
  2698.                         parameter.
  2699.  
  2700.           Return Value  None.
  2701.  
  2702.           Example
  2703.  
  2704.              char instr [11];
  2705.  
  2706.              empty(instr,10);             // empty the string
  2707.              get_string(instr);           // get up to 10 characters
  2708.                      // of input
  2709.  
  2710.  
  2711.  
  2712.  
  2713.  
  2714.  
  2715.  
  2716.  
  2717.  
  2718.  
  2719.  
  2720.  
  2721.  
  2722.  
  2723.  
  2724.  
  2725.  
  2726.  
  2727.  
  2728.  
  2729.  
  2730.  
  2731.  
  2732.                                        Page 48
  2733.  
  2734.  
  2735.  
  2736.           GAP Communications                                         GAPCDR
  2737.  
  2738.  
  2739.           fix_color
  2740.           -----------------------------------------------------------------
  2741.  
  2742.           Purpose       Modify ANSI driver according to user's color.
  2743.  
  2744.                         void fix_color(void);
  2745.  
  2746.           Type          Low Level
  2747.  
  2748.           Description   The ANSI  driver is  self modifying,  meaning  that
  2749.                         depending upon the color preference of the user, it
  2750.                         will adjusts its code accordingly. This function is
  2751.                         called by  init_ansi and  should never  need to  be
  2752.                         called  by   the  programmer  directly  unless  the
  2753.                         programmer provides  a menu choice whereby a caller
  2754.                         may toggle his/her color mode on and off. In such a
  2755.                         case, you  would immediately need to call fix_color
  2756.                         so that  the ANSI  driver can  adjusts itself.  The
  2757.                         caller's color preference is stored in the variable
  2758.                         color where 0 means no color, and 1 means color.
  2759.  
  2760.           Return Value  None.
  2761.  
  2762.           Example
  2763.  
  2764.              show_mess("Toggle Color",NO,NO);     // part of menu
  2765.  
  2766.              empty(response,1);           // clear string
  2767.              get_string(response);        // get response to menu
  2768.  
  2769.              if (response[0] == 'C')      // wants to toggle color
  2770.                {
  2771.                if (color)
  2772.                  color = 0
  2773.                else
  2774.                  color = 1;
  2775.  
  2776.                fix_color();               // fix up ANSI driver
  2777.                }
  2778.  
  2779.  
  2780.  
  2781.  
  2782.  
  2783.  
  2784.  
  2785.  
  2786.  
  2787.  
  2788.  
  2789.  
  2790.                                        Page 49
  2791.  
  2792.  
  2793.  
  2794.           GAP Communications                                         GAPCDR
  2795.  
  2796.  
  2797.           gapputc
  2798.           -----------------------------------------------------------------
  2799.  
  2800.           Purpose       Sends a single character to local and remote.
  2801.  
  2802.                         void gapputc(short ch);
  2803.  
  2804.                         ch         Character to send
  2805.  
  2806.           Type          Low Level
  2807.  
  2808.           Description   This is  one of  the main  output routines  that is
  2809.                         used internally  by GAPCDR.  It is part of the ANSI
  2810.                         driver. It  will send  a single  character  to  the
  2811.                         local screen  and if  a remote  caller is  on, will
  2812.                         send the  character to  the communications  port as
  2813.                         well.
  2814.  
  2815.           Return Value  None.
  2816.  
  2817.           Example       gapputc('A');             // display a character
  2818.  
  2819.              while ( (c = getakey()) == 0)        // wait for keypress
  2820.                dv_pause();                        // give up time slice
  2821.  
  2822.              gapputc(c);                  // display character
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.  
  2846.  
  2847.  
  2848.                                        Page 50
  2849.  
  2850.  
  2851.  
  2852.           GAP Communications                                         GAPCDR
  2853.  
  2854.  
  2855.           gapputs
  2856.           -----------------------------------------------------------------
  2857.  
  2858.           Purpose       Sends a string of characters to local and remote.
  2859.  
  2860.                         void gapputs(char *str);
  2861.  
  2862.                         str        String to send
  2863.  
  2864.           Type          Low Level
  2865.  
  2866.           Description   This is  one of  the main  output routines  that is
  2867.                         used internally  by GAPCDR.  It is part of the ANSI
  2868.                         driver. It  will send a string of characters to the
  2869.                         local screen  and if  a remote  caller is  on, will
  2870.                         send the string to the communications port as well.
  2871.                         If a  caller is  in mono mode, the ANSI driver will
  2872.                         strip any  ANSI sequences  from  the  string.  This
  2873.                         allows you  to "colorize"  your strings  with  ANSI
  2874.                         codes and  not have  to worry if the caller has his
  2875.                         color setting turned on.
  2876.  
  2877.                         This routine  is much  faster  than  show_mess  (in
  2878.                         fact, this  is the  function that show_mess calls),
  2879.                         but it  does not  provide for  ringing the  bell or
  2880.                         automatically sending  a carriage  return and  line
  2881.                         feed after  the string. You can however embed these
  2882.                         characters into  the string.  It is  suggested that
  2883.                         you not  embed the  bell character  into the string
  2884.                         since the  sysop may have the alarm toggled off and
  2885.                         may not  appreciate the  computer making noise when
  2886.                         he/she doesn't want it to.
  2887.  
  2888.           Return Value  None.
  2889.  
  2890.           Example       gapputs("This is a string of characters");
  2891.  
  2892.              // this example embeds the CR/LF pair at the beginning
  2893.              // and end of the string
  2894.  
  2895.              gapputs("\r\nThis is a string\r\n");
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.                                        Page 51
  2907.  
  2908.  
  2909.  
  2910.           GAP Communications                                         GAPCDR
  2911.  
  2912.  
  2913.           getakey
  2914.           -----------------------------------------------------------------
  2915.  
  2916.           Purpose       Gets one key responses
  2917.  
  2918.                         short getakey(void);
  2919.  
  2920.           Type          High Level
  2921.  
  2922.           Description   This is  the main  keyboard input  routine.  It  is
  2923.                         called  by  get_string  as  well  as  any  keyboard
  2924.                         polling loops. It checks the receive buffer as well
  2925.                         as the  local keyboard  for a  key press. If one is
  2926.                         not found  it returns 0. The character input is not
  2927.                         echoed. Since  99% of all keyboard input comes from
  2928.                         this  routine,   it  checks   for  time  remaining,
  2929.                         keyboard  time-out,   as  well   as  special  sysop
  2930.                         function keys.  The timeleft variable is updated by
  2931.                         this  routine.  This  is  the  variable  you  would
  2932.                         normally use in a prompt such as:
  2933.  
  2934.                                    [20 mins left] Main Command :
  2935.  
  2936.           Return Value  ASCII code for the key pressed or 0.
  2937.  
  2938.           Example       c = getakey();    // get a character
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.                                        Page 52
  2965.  
  2966.  
  2967.  
  2968.           GAP Communications                                         GAPCDR
  2969.  
  2970.  
  2971.           getkeyc
  2972.           -----------------------------------------------------------------
  2973.  
  2974.           Purpose       Gets keyboard character and scan code.
  2975.  
  2976.                         short getkeyc(void);
  2977.  
  2978.           Type          Low Level
  2979.  
  2980.           Description   This is  the main  keyboard input  routine which is
  2981.                         called  internally   by  getakey.  It  returns  the
  2982.                         keyboard character  or if  the key  struck  was  an
  2983.                         extended key,  it will  return a unique code. These
  2984.                         codes are  defined in  GAPSTRUC.H as F1, Home, etc.
  2985.                         This function  always waits  for a  keypress so  it
  2986.                         should not be called unless you know there is a key
  2987.                         waiting.
  2988.  
  2989.           Return Value  ASCII code for the key pressed or a unique code for
  2990.                         extended keys.
  2991.  
  2992.           Example       keyc = getkeyc(); // get a keyboard character
  2993.  
  2994.  
  2995.  
  2996.  
  2997.  
  2998.  
  2999.  
  3000.  
  3001.  
  3002.  
  3003.  
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.                                        Page 53
  3023.  
  3024.  
  3025.  
  3026.           GAP Communications                                         GAPCDR
  3027.  
  3028.  
  3029.           get_attr
  3030.           -----------------------------------------------------------------
  3031.  
  3032.           Purpose       Retrieves the current screen color.
  3033.  
  3034.                         void get_attr(void);
  3035.  
  3036.           Type          Low Level
  3037.  
  3038.           Description   This function  is used  at  the  very  start  of  a
  3039.                         program to  "remember" the  screen color. It stores
  3040.                         the color  in a special location so that the screen
  3041.                         attributes  can  be  restored  by  the  DOS  Window
  3042.                         routines. You  do not  need to call this routine if
  3043.                         you have no plans to use the DOS Window.
  3044.  
  3045.           Return Value  None. Attribute is stored in an internal location.
  3046.  
  3047.           Example       get_attr();       // Remember screen attributes
  3048.  
  3049.  
  3050.  
  3051.  
  3052.  
  3053.  
  3054.  
  3055.  
  3056.  
  3057.  
  3058.  
  3059.  
  3060.  
  3061.  
  3062.  
  3063.  
  3064.  
  3065.  
  3066.  
  3067.  
  3068.  
  3069.  
  3070.  
  3071.  
  3072.  
  3073.  
  3074.  
  3075.  
  3076.  
  3077.  
  3078.  
  3079.  
  3080.                                        Page 54
  3081.  
  3082.  
  3083.  
  3084.           GAP Communications                                         GAPCDR
  3085.  
  3086.  
  3087.           get_random
  3088.           -----------------------------------------------------------------
  3089.  
  3090.           Purpose       Gets a random number.
  3091.  
  3092.                         short get_random(short low,short high);
  3093.  
  3094.                         low        Lowest number acceptible
  3095.                         high       Highest number acceptible
  3096.  
  3097.           Type          High Level
  3098.  
  3099.           Description   This routine  is provided because it is much easier
  3100.                         to use  and understand  than the  C library routine
  3101.                         (which  drags   in  the  floating  point  library).
  3102.                         Provide as  parameters,  two  integers.  The  first
  3103.                         parameter is the lowest number you will accept as a
  3104.                         random number,  and the  second  parameter  is  the
  3105.                         highest random number you will accept. The function
  3106.                         will return  a random  integer  between  the  range
  3107.                         specified (low  and high  are included in the range
  3108.                         of numbers). It is not necessary to seed the random
  3109.                         number generator  as this is done automatically for
  3110.                         you during program initialization.
  3111.  
  3112.           Return Value  A random number between range specified.
  3113.  
  3114.           Example       rndnum = get_random(1,10);     // get a random num
  3115.  
  3116.  
  3117.  
  3118.  
  3119.  
  3120.  
  3121.  
  3122.  
  3123.  
  3124.  
  3125.  
  3126.  
  3127.  
  3128.  
  3129.  
  3130.  
  3131.  
  3132.  
  3133.  
  3134.  
  3135.  
  3136.  
  3137.  
  3138.                                        Page 55
  3139.  
  3140.  
  3141.  
  3142.           GAP Communications                                         GAPCDR
  3143.  
  3144.  
  3145.           get_string
  3146.           -----------------------------------------------------------------
  3147.  
  3148.           Purpose       Gets a string of characters.
  3149.  
  3150.                         void get_string(char *string);
  3151.  
  3152.                         string     Storage for input characters
  3153.  
  3154.           Type          High Level
  3155.  
  3156.           Description   This is  the main  input routine.  It  will  get  a
  3157.                         string from  either the  remote user  or the  local
  3158.                         keyboard. The  string passed  will be  set  to  the
  3159.                         characters received. The length of the input string
  3160.                         is determined by the length of the string passed.
  3161.  
  3162.                         Before calling,  you  must  initialize  the  passed
  3163.                         string with  spaces. The  number of  spaces in  the
  3164.                         string determines  the number of characters allowed
  3165.                         to be  input. If  a  user  attempts  to  type  more
  3166.                         characters than  allowed, the  cursor will not move
  3167.                         pass the  end of  the string.  Input ends  when the
  3168.                         Enter key is pressed.
  3169.  
  3170.                         To initialize the string, use the empty function.
  3171.  
  3172.                         WARNING : It is extremely important that the passed
  3173.                         string be initialized. Failure to set the string to
  3174.                         spaces, will cause unpredictable results!
  3175.  
  3176.                         This function  does not  return a  new string  con-
  3177.                         taining the  keyboard input.  Instead, it  modifies
  3178.                         the string  you pass  to it  in the parameter list.
  3179.                         The string will be stripped of any trailing spaces.
  3180.  
  3181.                         Get_string automatically  uppercases the string. If
  3182.                         you wish  to disable this feature, set the variable
  3183.                         noup to  1 just  prior to calling the function, and
  3184.                         then set it back to 0 when the function returns.
  3185.  
  3186.                         Get_string will  automatically check  for  keyboard
  3187.                         activity so it is not necessary for you to do so.
  3188.  
  3189.           Return Value  None
  3190.  
  3191.  
  3192.  
  3193.  
  3194.  
  3195.  
  3196.                                        Page 56
  3197.  
  3198.  
  3199.  
  3200.           GAP Communications                                         GAPCDR
  3201.  
  3202.  
  3203.           Example       get_string(instr);        // get a string
  3204.  
  3205.              char instr [20];
  3206.  
  3207.              // First initialize the string. In this case we will
  3208.              // accept up to 10 characters
  3209.  
  3210.              empty(instr,10);             // initialize string
  3211.              get_string(instr);           // get string
  3212.  
  3213.  
  3214.  
  3215.  
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.  
  3239.  
  3240.  
  3241.  
  3242.  
  3243.  
  3244.  
  3245.  
  3246.  
  3247.  
  3248.  
  3249.  
  3250.  
  3251.  
  3252.  
  3253.  
  3254.                                        Page 57
  3255.  
  3256.  
  3257.  
  3258.           GAP Communications                                         GAPCDR
  3259.  
  3260.  
  3261.           init_ansi
  3262.           -----------------------------------------------------------------
  3263.  
  3264.           Purpose       Initialize ANSI driver.
  3265.  
  3266.                         void init_ansi(void);
  3267.  
  3268.           Type          Low Level
  3269.  
  3270.           Description   This routine  is called  by init_door  so it is not
  3271.                         necessary for  you to call it again. It sets up the
  3272.                         ANSI driver  so that  it knows  the sysop's default
  3273.                         color, the current cursor position, etc.
  3274.  
  3275.           Return Value  None.
  3276.  
  3277.           Example       init_ansi();      // Initialize ANSI driver
  3278.  
  3279.  
  3280.  
  3281.  
  3282.  
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  
  3305.  
  3306.  
  3307.  
  3308.  
  3309.  
  3310.  
  3311.  
  3312.                                        Page 58
  3313.  
  3314.  
  3315.  
  3316.           GAP Communications                                         GAPCDR
  3317.  
  3318.  
  3319.           init_com
  3320.           -----------------------------------------------------------------
  3321.  
  3322.           Purpose       To configure the communications port.
  3323.  
  3324.                         void init_com(void);
  3325.  
  3326.           Type          High Level
  3327.  
  3328.           Description   This function  takes the  information  provided  by
  3329.                         DOOR.SYS and  makes a call to setport to set up the
  3330.                         communications  port  and  receive  buffer.  It  is
  3331.                         called internally  by init_door.  If  there  is  an
  3332.                         error setting  up the  port, init_com will exit the
  3333.                         program.
  3334.  
  3335.           Return Value  None. Exits on Error.
  3336.  
  3337.           Example       init_com();       // Initialize com port
  3338.  
  3339.  
  3340.  
  3341.  
  3342.  
  3343.  
  3344.  
  3345.  
  3346.  
  3347.  
  3348.  
  3349.  
  3350.  
  3351.  
  3352.  
  3353.  
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370.                                        Page 59
  3371.  
  3372.  
  3373.  
  3374.           GAP Communications                                         GAPCDR
  3375.  
  3376.  
  3377.           init_door
  3378.           -----------------------------------------------------------------
  3379.  
  3380.           Purpose       Initializes the GAPCDR functions.
  3381.  
  3382.                         void init_door(void);
  3383.  
  3384.           Type          High Level
  3385.  
  3386.           Description   This  routine  must  be  called  immediately  after
  3387.                         calling read_cnf.  It initializes  the door,  opens
  3388.                         and reads  system files,  initializes the com port,
  3389.                         initializes global  variables and in general, makes
  3390.                         sure that  all of  the files required for operation
  3391.                         are present.  If an  error occurs  while trying  to
  3392.                         initialize, the  function  will  display  an  error
  3393.                         message and end the program.
  3394.  
  3395.           Return Value  None. Exits on error.
  3396.  
  3397.           Example
  3398.  
  3399.              fp = read_cnf("DOOR.CNF");   // read cnf file
  3400.              init_door();                 // init the door
  3401.              fclose(fp);                  // close configuration file
  3402.  
  3403.  
  3404.  
  3405.  
  3406.  
  3407.  
  3408.  
  3409.  
  3410.  
  3411.  
  3412.  
  3413.  
  3414.  
  3415.  
  3416.  
  3417.  
  3418.  
  3419.  
  3420.  
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427.  
  3428.                                        Page 60
  3429.  
  3430.  
  3431.  
  3432.           GAP Communications                                         GAPCDR
  3433.  
  3434.  
  3435.           init_port
  3436.           -----------------------------------------------------------------
  3437.  
  3438.           Purpose       Initialize port to baud, data, and parity.
  3439.  
  3440.                         init_port(short parity, short data);
  3441.  
  3442.                         parity     0 = None, 1 = Even
  3443.                         data       6,7,or 8 data bits
  3444.  
  3445.           Type          Low Level
  3446.  
  3447.           Description   Sets the communications port to the parity and data
  3448.                         bits  passed   as  parameters.  The  baud  rate  is
  3449.                         contained in  a global  variabled called  baud. The
  3450.                         port  number   (where  COM  1  equals  port  0)  is
  3451.                         contained in a global variabled called port.
  3452.  
  3453.           Return Value  0 = Successful, 1 = Error.
  3454.  
  3455.           Example       init_port(0,8)    // Initialize to N,8,1
  3456.  
  3457.  
  3458.  
  3459.  
  3460.  
  3461.  
  3462.  
  3463.  
  3464.  
  3465.  
  3466.  
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472.  
  3473.  
  3474.  
  3475.  
  3476.  
  3477.  
  3478.  
  3479.  
  3480.  
  3481.  
  3482.  
  3483.  
  3484.  
  3485.  
  3486.                                        Page 61
  3487.  
  3488.  
  3489.  
  3490.           GAP Communications                                         GAPCDR
  3491.  
  3492.  
  3493.           iscd
  3494.           -----------------------------------------------------------------
  3495.  
  3496.           Purpose       Check for Carrier on the Communications Port.
  3497.  
  3498.                         short iscd(void);
  3499.  
  3500.           Type          Low Level
  3501.  
  3502.           Description   This function allows you to test the communications
  3503.                         port for a remote carrier signal. Note that carrier
  3504.                         checking  is   performed   automatically   by   the
  3505.                         communications routines  so it is not necessary for
  3506.                         you to explicitly check for carrier unless you have
  3507.                         a need to override the default actions taken.
  3508.  
  3509.           Return Value  Returns 0  if there is no carrier and 1 if there is
  3510.                         a carrier.
  3511.  
  3512.           Example
  3513.  
  3514.              if ( !iscd())                // is there a carrier?
  3515.                leave(99);                 // nope, lets quit
  3516.  
  3517.  
  3518.  
  3519.  
  3520.  
  3521.  
  3522.  
  3523.  
  3524.  
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530.  
  3531.  
  3532.  
  3533.  
  3534.  
  3535.  
  3536.  
  3537.  
  3538.  
  3539.  
  3540.  
  3541.  
  3542.  
  3543.  
  3544.                                        Page 62
  3545.  
  3546.  
  3547.  
  3548.           GAP Communications                                         GAPCDR
  3549.  
  3550.  
  3551.           leave
  3552.           -----------------------------------------------------------------
  3553.  
  3554.           Purpose       Exits the program.
  3555.  
  3556.                         void leave(short code);
  3557.  
  3558.                         code       Exit code to terminate with
  3559.  
  3560.           Type          High Level
  3561.  
  3562.           Description   When the  program terminates,  it  must  call  this
  3563.                         function to  end. This is the only proper exit from
  3564.                         the door.  It is  of vital  importance to  end your
  3565.                         program through this function so that the interrupt
  3566.                         service  routines   that  are   installed  at  door
  3567.                         beginning can be removed.
  3568.  
  3569.           Return Value  None.
  3570.  
  3571.           Example       leave(0);       // Exit the program
  3572.  
  3573.  
  3574.  
  3575.  
  3576.  
  3577.  
  3578.  
  3579.  
  3580.  
  3581.  
  3582.  
  3583.  
  3584.  
  3585.  
  3586.  
  3587.  
  3588.  
  3589.  
  3590.  
  3591.  
  3592.  
  3593.  
  3594.  
  3595.  
  3596.  
  3597.  
  3598.  
  3599.  
  3600.  
  3601.  
  3602.                                        Page 63
  3603.  
  3604.  
  3605.  
  3606.           GAP Communications                                         GAPCDR
  3607.  
  3608.  
  3609.           lputc, lputs
  3610.           -----------------------------------------------------------------
  3611.  
  3612.           Purpose       To display  a character  or string of characters on
  3613.                         the local screen.
  3614.  
  3615.                         void lputc(char ch);
  3616.  
  3617.                         ch         Character to display
  3618.  
  3619.                         void lputs(char *str);
  3620.  
  3621.                         str        String to display
  3622.  
  3623.           Type          Low Level
  3624.  
  3625.           Description   Like gapputc  and gapputs,  these functions display
  3626.                         either  a   single  character   or  a   string   of
  3627.                         characters,  however   the   characters   are   not
  3628.                         simultaneously sent  to the  communications port as
  3629.                         well. These  functions override  the color  mode of
  3630.                         the caller  and allow you to send ANSI color to the
  3631.                         local screen  even if  the caller does not have his
  3632.                         color flag turned on.
  3633.  
  3634.           Return Value  None.
  3635.  
  3636.           Example       lputs("This is a string");     // Send string
  3637.  
  3638.  
  3639.  
  3640.  
  3641.  
  3642.  
  3643.  
  3644.  
  3645.  
  3646.  
  3647.  
  3648.  
  3649.  
  3650.  
  3651.  
  3652.  
  3653.  
  3654.  
  3655.  
  3656.  
  3657.  
  3658.  
  3659.  
  3660.                                        Page 64
  3661.  
  3662.  
  3663.  
  3664.           GAP Communications                                         GAPCDR
  3665.  
  3666.  
  3667.           more
  3668.           -----------------------------------------------------------------
  3669.  
  3670.           Purpose       Checks for a full screen and issues a More Prompt.
  3671.  
  3672.                         void more(void);
  3673.  
  3674.           Type          High Level
  3675.  
  3676.           Description   This is  an internal  routine that is called by the
  3677.                         character output functions. It issues a more prompt
  3678.                         if the number of lines displayed reaches the user's
  3679.                         page length.
  3680.  
  3681.           Return Value  None.
  3682.  
  3683.  
  3684.  
  3685.  
  3686.  
  3687.  
  3688.  
  3689.  
  3690.  
  3691.  
  3692.  
  3693.  
  3694.  
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700.  
  3701.  
  3702.  
  3703.  
  3704.  
  3705.  
  3706.  
  3707.  
  3708.  
  3709.  
  3710.  
  3711.  
  3712.  
  3713.  
  3714.  
  3715.  
  3716.  
  3717.  
  3718.                                        Page 65
  3719.  
  3720.  
  3721.  
  3722.           GAP Communications                                         GAPCDR
  3723.  
  3724.  
  3725.           nl
  3726.           -----------------------------------------------------------------
  3727.  
  3728.           Purpose       Sends a  Carriage Return and Line Feed to local and
  3729.                         remote.
  3730.  
  3731.                         void nl(short lines);
  3732.  
  3733.                         lines      Number of New Lines to send
  3734.  
  3735.           Type          High Level
  3736.  
  3737.           Description   To send  a blank  line, call  this routine with the
  3738.                         number of blank lines you wish to send.
  3739.  
  3740.           Return Value  None
  3741.  
  3742.           Example       nl(2);          // send two blank lines
  3743.  
  3744.  
  3745.  
  3746.  
  3747.  
  3748.  
  3749.  
  3750.  
  3751.  
  3752.  
  3753.  
  3754.  
  3755.  
  3756.  
  3757.  
  3758.  
  3759.  
  3760.  
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766.  
  3767.  
  3768.  
  3769.  
  3770.  
  3771.  
  3772.  
  3773.  
  3774.  
  3775.  
  3776.                                        Page 66
  3777.  
  3778.  
  3779.  
  3780.           GAP Communications                                         GAPCDR
  3781.  
  3782.  
  3783.           no_carrier
  3784.           -----------------------------------------------------------------
  3785.  
  3786.           Purpose       Used by the Communications routines.
  3787.  
  3788.                         void no_carrier(void);
  3789.  
  3790.           Type          High Level
  3791.  
  3792.           Description   Internal routine  that is  called when  there is  a
  3793.                         loss of  carrier. Displays  a message  to the local
  3794.                         screen  and  then  calls  leave  to  terminate  the
  3795.                         program. This  function must  not be  removed  from
  3796.                         GAPCDR. You  may modify  it to  change the  default
  3797.                         actions that  are  taken,  but  the  communications
  3798.                         routines must  have access to it if there is a loss
  3799.                         of carrier.
  3800.  
  3801.           Return Value  None.
  3802.  
  3803.           Example
  3804.  
  3805.  
  3806.  
  3807.  
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.                                        Page 67
  3835.  
  3836.  
  3837.  
  3838.           GAP Communications                                         GAPCDR
  3839.  
  3840.  
  3841.           pagesysop
  3842.           -----------------------------------------------------------------
  3843.  
  3844.           Purpose       Alerts sysop that user wants to chat.
  3845.  
  3846.                         void pagesysop(void);
  3847.  
  3848.           Type          High Level
  3849.  
  3850.           Description   Allows the  programer to  provide the  user with  a
  3851.                         Page Sysop  command. The  page lasts for 30 seconds
  3852.                         and can be aborted by typing CTRL-K. If the sysop's
  3853.                         page bell  is on,  the sysop's  speaker  will  also
  3854.                         sound. To  answer the  page, the sysop should press
  3855.                         CTRL-F10.
  3856.  
  3857.           Return Value  None.
  3858.  
  3859.           Example       pagesysop();      // tell sysop
  3860.  
  3861.              empty(response,1);           // initialize string
  3862.  
  3863.              get_string(response);        // get a response
  3864.  
  3865.              if (response[0] == 'P')      // wants to chat
  3866.                pagesysop();               // tell sysop
  3867.  
  3868.  
  3869.  
  3870.  
  3871.  
  3872.  
  3873.  
  3874.  
  3875.  
  3876.  
  3877.  
  3878.  
  3879.  
  3880.  
  3881.  
  3882.  
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.  
  3892.                                        Page 68
  3893.  
  3894.  
  3895.  
  3896.           GAP Communications                                         GAPCDR
  3897.  
  3898.  
  3899.           pause
  3900.           -----------------------------------------------------------------
  3901.  
  3902.           Purpose       Sends a "Press [Any Key] To Continue" prompt.
  3903.  
  3904.                         void pause(void);
  3905.  
  3906.           Type          High Level
  3907.  
  3908.           Description   This function  sends a pause prompt and waits for a
  3909.                         key press.
  3910.  
  3911.           Return Value  None.
  3912.  
  3913.           Example       pause();        // display pause prompt
  3914.  
  3915.  
  3916.  
  3917.  
  3918.  
  3919.  
  3920.  
  3921.  
  3922.  
  3923.  
  3924.  
  3925.  
  3926.  
  3927.  
  3928.  
  3929.  
  3930.  
  3931.  
  3932.  
  3933.  
  3934.  
  3935.  
  3936.  
  3937.  
  3938.  
  3939.  
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.                                        Page 69
  3951.  
  3952.  
  3953.  
  3954.           GAP Communications                                         GAPCDR
  3955.  
  3956.  
  3957.           putkey
  3958.           -----------------------------------------------------------------
  3959.  
  3960.           Purpose       Used  by  chat  routines  to  keep  track  of  word
  3961.                         wrapping.
  3962.  
  3963.                         void putkey(short ch);
  3964.  
  3965.                         ch         Character to send
  3966.  
  3967.           Type          High Level
  3968.  
  3969.           Description   This is  the  main  output  routine  for  the  chat
  3970.                         functions. It  keeps track  of the  current column,
  3971.                         and decides when it is time to wrap a word.
  3972.  
  3973.           Return Value  None.
  3974.  
  3975.           Example
  3976.  
  3977.  
  3978.  
  3979.  
  3980.  
  3981.  
  3982.  
  3983.  
  3984.  
  3985.  
  3986.  
  3987.  
  3988.  
  3989.  
  3990.  
  3991.  
  3992.  
  3993.  
  3994.  
  3995.  
  3996.  
  3997.  
  3998.  
  3999.  
  4000.  
  4001.  
  4002.  
  4003.  
  4004.  
  4005.  
  4006.  
  4007.  
  4008.                                        Page 70
  4009.  
  4010.  
  4011.  
  4012.           GAP Communications                                         GAPCDR
  4013.  
  4014.  
  4015.           read_cnf
  4016.           -----------------------------------------------------------------
  4017.  
  4018.           Purpose       Reads the door configuration file.
  4019.  
  4020.                         FILE *read_cnf(char *path);
  4021.  
  4022.                         path       Full path and name of configuration file
  4023.  
  4024.           Type          High Level
  4025.  
  4026.           Description   Opens the  configuration file for the current door.
  4027.                         Normally the  passed parameter  is the  name of the
  4028.                         door with  a .CNF extension (it is assumed that the
  4029.                         file is in the same directory as the door program).
  4030.                         If an error occurs, the program ends immediately.
  4031.  
  4032.                         WARNING :  The first eight lines of this configura-
  4033.                         tion file  belong to  the GAPCDR  interface module.
  4034.                         You are  free to  use the  information, but the in-
  4035.                         formation contained  in the  first eight lines must
  4036.                         conform exactly to the following specifications.
  4037.  
  4038.                         The first  line of  this file is the full drive and
  4039.                         path to  the BBS  default directory.  This  is  the
  4040.                         directory where  the BBS created the DOOR.SYS file.
  4041.                         The second  line is  the name of the BBS. The third
  4042.                         line is  the IRQ  for the port, and the fourth line
  4043.                         is the Base Address for the port. If the sysop uses
  4044.                         Com Ports other than 1 or 2, then he must enter the
  4045.                         appropriate IRQ and BASE address so that GAPCDR can
  4046.                         properly open  the port.  If Com  ports 1  or 2 are
  4047.                         used, then  a 0  may be  entered on  both of  these
  4048.                         lines. The  fifth line  is the  Communications Port
  4049.                         Interface and  must be  either STANDARD, DIGIBOARD,
  4050.                         or INT14/EBIOS.  The sixth  line is  the  DigiBoard
  4051.                         Memory Window.  The seventh  line is  the DigiBoard
  4052.                         I/O Port  Address. The eighth line is the DigiBoard
  4053.                         Channel Number.
  4054.  
  4055.                         It is  the responsibility  of the  door  author  to
  4056.                         describe the format of these eight lines to the end
  4057.                         user.   If    your   door   program   requires   no
  4058.                         configuration parameters of its own, you can simply
  4059.                         distribute a  sample configuration  file with these
  4060.                         eight lines already in it.
  4061.  
  4062.  
  4063.  
  4064.  
  4065.  
  4066.                                        Page 71
  4067.  
  4068.  
  4069.  
  4070.           GAP Communications                                         GAPCDR
  4071.  
  4072.  
  4073.                         GAPCDR will  not close  this file after reading the
  4074.                         first four  lines. It  leaves the file open for the
  4075.                         programmer's use.  Remember that  you assign a FILE
  4076.                         pointer to  the return value so that you may access
  4077.                         the  file.   If  your  door  does  require  certain
  4078.                         configuration parameters, have your users place the
  4079.                         parameters in the file starting with line 9. If you
  4080.                         use a  set up  program, be  sure that  your set  up
  4081.                         program writes the first eight lines as specified.
  4082.  
  4083.                         After you  have called  read_cnf and  init_door, if
  4084.                         you  have   any  configuration   options   in   the
  4085.                         configuration file, you should use the stream input
  4086.                         routines to  read those  options. Then  fclose  the
  4087.                         file using  the FILE  pointer returned. Even if you
  4088.                         have no options to read, you must close the file.
  4089.  
  4090.                         WARNING :  You must  call this routine before using
  4091.                         any of  the GAPCDR  functions. After  calling  this
  4092.                         routine, you must call init_door.
  4093.  
  4094.           Return Value  FILE pointer.
  4095.  
  4096.           Example
  4097.  
  4098.              FILE *fp;   // File pointer
  4099.  
  4100.              fp = read_cnf("TOURIST.CNF");        // read cnf file
  4101.              fclose(fp);                          // close the file
  4102.              init_door();                         // init the door
  4103.  
  4104.  
  4105.  
  4106.  
  4107.  
  4108.  
  4109.  
  4110.  
  4111.  
  4112.  
  4113.  
  4114.  
  4115.  
  4116.  
  4117.  
  4118.  
  4119.  
  4120.  
  4121.  
  4122.  
  4123.  
  4124.                                        Page 72
  4125.  
  4126.  
  4127.  
  4128.           GAP Communications                                         GAPCDR
  4129.  
  4130.  
  4131.           read_doorsys
  4132.           -----------------------------------------------------------------
  4133.  
  4134.           Purpose       Reads the DOOR.SYS universal door interface file.
  4135.  
  4136.                         short read_doorsys(void);
  4137.  
  4138.           Type          High Level
  4139.  
  4140.           Description   Internal routine  called by  init_door.  Reads  the
  4141.                         DOOR.SYS file  and initializes any global variables
  4142.                         that depend on the information in that file.
  4143.  
  4144.           Return Value  0 = no error, 1 = error.
  4145.  
  4146.           Example       c = read_doorsys();
  4147.  
  4148.  
  4149.  
  4150.  
  4151.  
  4152.  
  4153.  
  4154.  
  4155.  
  4156.  
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.  
  4165.  
  4166.  
  4167.  
  4168.  
  4169.  
  4170.  
  4171.  
  4172.  
  4173.  
  4174.  
  4175.  
  4176.  
  4177.  
  4178.  
  4179.  
  4180.  
  4181.  
  4182.                                        Page 73
  4183.  
  4184.  
  4185.  
  4186.           GAP Communications                                         GAPCDR
  4187.  
  4188.  
  4189.           read_gapuser
  4190.           -----------------------------------------------------------------
  4191.  
  4192.           Purpose       Reads the GAP Communications USERS.DAT file.
  4193.  
  4194.                         short read_gapuser(char *path);
  4195.  
  4196.                         path       Full path and name of the USERS file
  4197.  
  4198.           Type          High Level
  4199.  
  4200.           Description   Reads the  user record  of the  current user in the
  4201.                         GAP USERS.DAT  file. The  record  is  read  into  a
  4202.                         structure variable  called gapuser. You must supply
  4203.                         the path  and name  to the  base part  of the  User
  4204.                         file. GAP  stores the  name of the User file in the
  4205.                         GAPBBS.CNF file  (which you  must  read  yourself).
  4206.                         Read_gapuser will add the .DAT extension.
  4207.  
  4208.           Return Value  0 = no error, 1 = error.
  4209.  
  4210.           Example       c = read_gapuser(userpath);
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.  
  4221.  
  4222.  
  4223.  
  4224.  
  4225.  
  4226.  
  4227.  
  4228.  
  4229.  
  4230.  
  4231.  
  4232.  
  4233.  
  4234.  
  4235.  
  4236.  
  4237.  
  4238.  
  4239.  
  4240.                                        Page 74
  4241.  
  4242.  
  4243.  
  4244.           GAP Communications                                         GAPCDR
  4245.  
  4246.  
  4247.           read_pcbsys
  4248.           -----------------------------------------------------------------
  4249.  
  4250.           Purpose       Reads the PCBOARD.SYS file.
  4251.  
  4252.                         short read_pcbsys(void);
  4253.  
  4254.           Type          High Level
  4255.  
  4256.           Description   Reads the  PCBOARD.SYS system  file. The  record is
  4257.                         read into a structure variable called pcbsys.
  4258.  
  4259.           Return Value  0 = no error, 1 = error.
  4260.  
  4261.           Example       c = read_pcbsys();
  4262.  
  4263.  
  4264.  
  4265.  
  4266.  
  4267.  
  4268.  
  4269.  
  4270.  
  4271.  
  4272.  
  4273.  
  4274.  
  4275.  
  4276.  
  4277.  
  4278.  
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.  
  4297.  
  4298.                                        Page 75
  4299.  
  4300.  
  4301.  
  4302.           GAP Communications                                         GAPCDR
  4303.  
  4304.  
  4305.           read_pcbuser
  4306.           -----------------------------------------------------------------
  4307.  
  4308.           Purpose       Reads the PCB USERS file.
  4309.  
  4310.                         short read_pcbuser(char *path);
  4311.  
  4312.                         path       Full path and name of the USERS file
  4313.  
  4314.           Type          High Level
  4315.  
  4316.           Description   Reads the  user record  of the  current user in the
  4317.                         PCB USERS file. The record is read into a structure
  4318.                         variable called  pcbuser. You  must supply the path
  4319.                         and name to the User file. PCB stores the path\name
  4320.                         of the User file in the PCBOARD.DAT file (which you
  4321.                         must read yourself).
  4322.  
  4323.           Return Value  0 = no error, 1 = error.
  4324.  
  4325.           Example       c = read_pcbuser(userpath);
  4326.  
  4327.  
  4328.  
  4329.  
  4330.  
  4331.  
  4332.  
  4333.  
  4334.  
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355.  
  4356.                                        Page 76
  4357.  
  4358.  
  4359.  
  4360.           GAP Communications                                         GAPCDR
  4361.  
  4362.  
  4363.           read_score
  4364.           -----------------------------------------------------------------
  4365.  
  4366.           Purpose       Reads the score file and displays the results.
  4367.  
  4368.                         short read_score(char *datfile,char *message);
  4369.  
  4370.                         datfile    Path and name of data file to read
  4371.                         message    Message to display
  4372.  
  4373.           Type          High Level
  4374.  
  4375.           Description   This function  will read  the scoreboard  data file
  4376.                         for your door (if any) and display the results. You
  4377.                         pass as  parameters the  name of  the data  file to
  4378.                         read, and  a message  to display  at the top of the
  4379.                         scoreboard. The  message could  be  something  like
  4380.                         "Top 10 Players".
  4381.  
  4382.           Return Value  0 = scores read, 1 = no scores to read.
  4383.  
  4384.           Example       read_score("TOURIST.DAT","Top 10 Tourists");
  4385.  
  4386.              if (read_score("TOURIST.DAT","Top 10 Tourists"))
  4387.                {
  4388.                nl(1);
  4389.                ansi(BWHITE);
  4390.                show_mess("No one's made it Yet!",NO,YES);
  4391.                }
  4392.  
  4393.  
  4394.  
  4395.  
  4396.  
  4397.  
  4398.  
  4399.  
  4400.  
  4401.  
  4402.  
  4403.  
  4404.  
  4405.  
  4406.  
  4407.  
  4408.  
  4409.  
  4410.  
  4411.  
  4412.  
  4413.  
  4414.                                        Page 77
  4415.  
  4416.  
  4417.  
  4418.           GAP Communications                                         GAPCDR
  4419.  
  4420.  
  4421.           reset_port
  4422.           -----------------------------------------------------------------
  4423.  
  4424.           Purpose       Restores the Communications port.
  4425.  
  4426.                         void reset_port(void);
  4427.  
  4428.           Type          Low Level
  4429.  
  4430.           Description   This function  must be  called prior to exiting the
  4431.                         program. It  restores the  interrupt vector used by
  4432.                         the   communications   routines.   It   is   called
  4433.                         internally by  leave so it is not necessary for you
  4434.                         to explicitly invoke it.
  4435.  
  4436.           Return Value  None.
  4437.  
  4438.           Example       reset_port();     // Restore communications port
  4439.  
  4440.  
  4441.  
  4442.  
  4443.  
  4444.  
  4445.  
  4446.  
  4447.  
  4448.  
  4449.  
  4450.  
  4451.  
  4452.  
  4453.  
  4454.  
  4455.  
  4456.  
  4457.  
  4458.  
  4459.  
  4460.  
  4461.  
  4462.  
  4463.  
  4464.  
  4465.  
  4466.  
  4467.  
  4468.  
  4469.  
  4470.  
  4471.  
  4472.                                        Page 78
  4473.  
  4474.  
  4475.  
  4476.           GAP Communications                                         GAPCDR
  4477.  
  4478.  
  4479.           restore_screen
  4480.           -----------------------------------------------------------------
  4481.  
  4482.           Purpose       Restores a previously saved portion of the screen.
  4483.  
  4484.                         void restore_screen(short topr, short topc,
  4485.                                             short botr, short botc,
  4486.                                             unsigned short memseg);
  4487.  
  4488.                         topr       Top row of screen
  4489.                         topc       Top left column of screen
  4490.                         botr       Bottom row of screen
  4491.                         botc       Bottom right column of screen
  4492.                         memseg     Segment of buffer to save to
  4493.  
  4494.           Type          Low Level
  4495.  
  4496.           Description   This function  allows you  to restore  a previously
  4497.                         saved portion of the screen. You supply the top row
  4498.                         and column  and  the  bottom  row  and  column  co-
  4499.                         ordinates of  the rectangle. All co-ordinates are 0
  4500.                         based. The  memseg is  the segment  address of  the
  4501.                         buffer that  a previous  call to  save_screen saved
  4502.                         the video contents to.
  4503.  
  4504.           Return Value  None.
  4505.  
  4506.           Example       restore_screen(3,8,16,71,dseg);
  4507.  
  4508.  
  4509.  
  4510.  
  4511.  
  4512.  
  4513.  
  4514.  
  4515.  
  4516.  
  4517.  
  4518.  
  4519.  
  4520.  
  4521.  
  4522.  
  4523.  
  4524.  
  4525.  
  4526.  
  4527.  
  4528.  
  4529.  
  4530.                                        Page 79
  4531.  
  4532.  
  4533.  
  4534.           GAP Communications                                         GAPCDR
  4535.  
  4536.  
  4537.           rest_cbreak
  4538.           -----------------------------------------------------------------
  4539.  
  4540.           Purpose       Restores the Ctrl-Break vector.
  4541.  
  4542.                         void rest_cbreak(void);
  4543.  
  4544.           Type          Low Level
  4545.  
  4546.           Description   This function  must be  called prior to exiting the
  4547.                         program. It  restores the  interrupt vector used by
  4548.                         the Ctrl-Break  routine. It is called internally by
  4549.                         leave so  it is not necessary for you to explicitly
  4550.                         invoke it.
  4551.  
  4552.           Return Value  None.
  4553.  
  4554.           Example       rest_cbreak();    // restore Ctrl-Break vector
  4555.  
  4556.  
  4557.  
  4558.  
  4559.  
  4560.  
  4561.  
  4562.  
  4563.  
  4564.  
  4565.  
  4566.  
  4567.  
  4568.  
  4569.  
  4570.  
  4571.  
  4572.  
  4573.  
  4574.  
  4575.  
  4576.  
  4577.  
  4578.  
  4579.  
  4580.  
  4581.  
  4582.  
  4583.  
  4584.  
  4585.  
  4586.  
  4587.  
  4588.                                        Page 80
  4589.  
  4590.  
  4591.  
  4592.           GAP Communications                                         GAPCDR
  4593.  
  4594.  
  4595.           rest_int10
  4596.           -----------------------------------------------------------------
  4597.  
  4598.           Purpose       Restores the interrupt 10 (BIOS) vector.
  4599.  
  4600.                         void rest_int10(void);
  4601.  
  4602.           Type          Low Level
  4603.  
  4604.           Description   When setting  up  an  interrupt  10  BIOS  trap  to
  4605.                         protect a  DOS Window, this function must be called
  4606.                         when it is no longer necessary to protect a portion
  4607.                         of the screen.
  4608.  
  4609.           Return Value  None.
  4610.  
  4611.           Example       See the example for set_cord.
  4612.  
  4613.  
  4614.  
  4615.  
  4616.  
  4617.  
  4618.  
  4619.  
  4620.  
  4621.  
  4622.  
  4623.  
  4624.  
  4625.  
  4626.  
  4627.  
  4628.  
  4629.  
  4630.  
  4631.  
  4632.  
  4633.  
  4634.  
  4635.  
  4636.  
  4637.  
  4638.  
  4639.  
  4640.  
  4641.  
  4642.  
  4643.  
  4644.  
  4645.  
  4646.                                        Page 81
  4647.  
  4648.  
  4649.  
  4650.           GAP Communications                                         GAPCDR
  4651.  
  4652.  
  4653.           rts
  4654.           -----------------------------------------------------------------
  4655.  
  4656.           Purpose       Toggle the RTS line on and off.
  4657.  
  4658.                         void rts(short how)
  4659.  
  4660.                         how        0 = Turn RTS off.
  4661.                                    1 = Turn RTS on
  4662.  
  4663.           Type          Low Level
  4664.  
  4665.           Description   This routine  is used  to turn  the RTS line of the
  4666.                         communications port  on or  off.  Turning  RTS  off
  4667.                         (providing the modem supports hardware handshaking)
  4668.                         tells  the  modem  to  stop  sending  data  to  the
  4669.                         computer. It is typically toggled off while writing
  4670.                         a buffer of data to a disk.
  4671.  
  4672.           Return Value  None.
  4673.  
  4674.           Example       rts(0);         // Turn RTS off
  4675.  
  4676.  
  4677.  
  4678.  
  4679.  
  4680.  
  4681.  
  4682.  
  4683.  
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.  
  4693.  
  4694.  
  4695.  
  4696.  
  4697.  
  4698.  
  4699.  
  4700.  
  4701.  
  4702.  
  4703.  
  4704.                                        Page 82
  4705.  
  4706.  
  4707.  
  4708.           GAP Communications                                         GAPCDR
  4709.  
  4710.  
  4711.           rxempty
  4712.           -----------------------------------------------------------------
  4713.  
  4714.           Purpose       To check if there are any characters in the receive
  4715.                         buffer.
  4716.  
  4717.                         short rxempty(void);
  4718.  
  4719.           Type          Low Level
  4720.  
  4721.           Description   This function  checks  the  communications  receive
  4722.                         buffer to  see if  there are any characters waiting
  4723.                         to be read.
  4724.  
  4725.           Return Value  Returns 1  if buffer  is  empty,  0  if  there  are
  4726.                         characters waiting to be read.
  4727.  
  4728.           Example
  4729.  
  4730.              while (rxempty())            // nothing happening
  4731.                dv_pause();                // give up time slice
  4732.  
  4733.  
  4734.  
  4735.  
  4736.  
  4737.  
  4738.  
  4739.  
  4740.  
  4741.  
  4742.  
  4743.  
  4744.  
  4745.  
  4746.  
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754.  
  4755.  
  4756.  
  4757.  
  4758.  
  4759.  
  4760.  
  4761.  
  4762.                                        Page 83
  4763.  
  4764.  
  4765.  
  4766.           GAP Communications                                         GAPCDR
  4767.  
  4768.  
  4769.           save_screen
  4770.           -----------------------------------------------------------------
  4771.  
  4772.           Purpose       Saves a portion of the screen.
  4773.  
  4774.                         void save_screen(short topr, short topc,
  4775.                                          short botr, short botc,
  4776.                                          unsigned short memseg);
  4777.  
  4778.                         topr       Top row of screen
  4779.                         topc       Top left column of screen
  4780.                         botr       Bottom row of screen
  4781.                         botc       Bottom right column of screen
  4782.                         memseg     Segment of buffer to save to
  4783.  
  4784.           Type          Low Level
  4785.  
  4786.           Description   This function  allows you  to  save  a  rectangular
  4787.                         portion of  the screen.  You supply the top row and
  4788.                         column and  the bottom  row and column co-ordinates
  4789.                         of the rectangle. All co-ordinates are 0 based. The
  4790.                         memseg is  the segment  address of a buffer to save
  4791.                         the video  contents to  and assumes your buffer was
  4792.                         allocated by  DOS (i.e.,  the offset portion of the
  4793.                         buffer begins at 0).
  4794.  
  4795.           Return Value  None.
  4796.  
  4797.           Example
  4798.  
  4799.              unsigned short dseg;
  4800.  
  4801.              dos_allocatemem(114,&dseg);  // get some memory
  4802.              save_screen(3,8,16,71,dseg); // save contents of video
  4803.  
  4804.  
  4805.  
  4806.  
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.  
  4813.  
  4814.  
  4815.  
  4816.  
  4817.  
  4818.  
  4819.  
  4820.                                        Page 84
  4821.  
  4822.  
  4823.  
  4824.           GAP Communications                                         GAPCDR
  4825.  
  4826.  
  4827.           setport
  4828.           -----------------------------------------------------------------
  4829.  
  4830.           Purpose       Initialize the Communications Port.
  4831.  
  4832.                         short set_port(short bufsize, short irq,
  4833.                                        short base);
  4834.  
  4835.                         bufsize    Size of Receive buffer
  4836.                         irq        Port IRQ to use
  4837.                         base       Port Base Address to use
  4838.  
  4839.           Type          Low Level
  4840.  
  4841.           Description   This is  the port  initialization routine  that  is
  4842.                         called by  init_com. Bufsize  is the  size  of  the
  4843.                         receive buffer  to set  up. Set_port  will allocate
  4844.                         memory based  upon this  size. Typical  values  are
  4845.                         from 1200  to 4096  bytes. Note  that  the  bufsize
  4846.                         argument  is   ignored  when   using  the   Borland
  4847.                         compiler. This  is because Borland does not provide
  4848.                         a memory  allocation routine  that allocates memory
  4849.                         in the  near heap  (irregardless of  memory model).
  4850.                         For Borland,  the bufsize  is fixed  at 2048 bytes.
  4851.                         IRQ is  the Interrupt Request number to use for the
  4852.                         port and Base Address is the address where the port
  4853.                         is located.  The Port  number is  a global variable
  4854.                         that is set when reading DOOR.SYS. Ports start with
  4855.                         0, where  0 equals  COM 1, 1 equals COM 2, etc. For
  4856.                         COM 1  and COM  2, you may simply pass 0 as the IRQ
  4857.                         and Base address since the defaults for these ports
  4858.                         will be used.
  4859.  
  4860.           Return Value  0 = successful, 1 = error encountered.
  4861.  
  4862.           Example
  4863.  
  4864.              // set up the port with a buffer size of 2k, using COM 1
  4865.  
  4866.              port = 0;
  4867.  
  4868.              if (setport(2048, 0, 0))
  4869.                exit(1);
  4870.  
  4871.  
  4872.  
  4873.  
  4874.  
  4875.  
  4876.  
  4877.  
  4878.                                        Page 85
  4879.  
  4880.  
  4881.  
  4882.           GAP Communications                                         GAPCDR
  4883.  
  4884.  
  4885.           set_attr
  4886.           -----------------------------------------------------------------
  4887.  
  4888.           Purpose       Sets the video color attributes.
  4889.  
  4890.                         void set_attr(unsigned  char  forg,  unsigned  char
  4891.                         back);
  4892.  
  4893.                         forg       Foreground Color (0-15)
  4894.                         back       Background Color (0-7)
  4895.  
  4896.           Type          Low Level
  4897.  
  4898.           Description   This function  is used just prior to invoking a DOS
  4899.                         Window so that the window colors can be set.
  4900.  
  4901.           Return Value  None.
  4902.  
  4903.           Example       See the example for set_cord.
  4904.  
  4905.  
  4906.  
  4907.  
  4908.  
  4909.  
  4910.  
  4911.  
  4912.  
  4913.  
  4914.  
  4915.  
  4916.  
  4917.  
  4918.  
  4919.  
  4920.  
  4921.  
  4922.  
  4923.  
  4924.  
  4925.  
  4926.  
  4927.  
  4928.  
  4929.  
  4930.  
  4931.  
  4932.  
  4933.  
  4934.  
  4935.  
  4936.                                        Page 86
  4937.  
  4938.  
  4939.  
  4940.           GAP Communications                                         GAPCDR
  4941.  
  4942.  
  4943.           set_cbreak
  4944.           -----------------------------------------------------------------
  4945.  
  4946.           Purpose       Initializes the Ctrl-Break vector.
  4947.  
  4948.                         void set_cbreak(void);
  4949.  
  4950.           Type          Low Level
  4951.  
  4952.           Description   To trap Ctrl-C and Ctrl-Break, this function should
  4953.                         be called to set up an interrupt service routine to
  4954.                         trap these  two keys.  It is  imperitive  that  the
  4955.                         program not exit before calling rest_cbreak so that
  4956.                         the interrupt  vector can  be restored.  Leave does
  4957.                         this for you automatically.
  4958.  
  4959.           Return Value  None.
  4960.  
  4961.           Example       set_cbreak();     // set up Ctrl-Break ISR
  4962.  
  4963.  
  4964.  
  4965.  
  4966.  
  4967.  
  4968.  
  4969.  
  4970.  
  4971.  
  4972.  
  4973.  
  4974.  
  4975.  
  4976.  
  4977.  
  4978.  
  4979.  
  4980.  
  4981.  
  4982.  
  4983.  
  4984.  
  4985.  
  4986.  
  4987.  
  4988.  
  4989.  
  4990.  
  4991.  
  4992.  
  4993.  
  4994.                                        Page 87
  4995.  
  4996.  
  4997.  
  4998.           GAP Communications                                         GAPCDR
  4999.  
  5000.  
  5001.           set_cord
  5002.           -----------------------------------------------------------------
  5003.  
  5004.           Purpose       Set up a DOS Window.
  5005.  
  5006.                         void set_cord(unsigned char topr,
  5007.                                       unsigned char topc,
  5008.                                       unsigned char botr,
  5009.                                       unsigned char botc);
  5010.  
  5011.                         topr       Top left row
  5012.                         topc       Top left column
  5013.                         botr       Bottom row
  5014.                         botc       Bottom right column
  5015.  
  5016.           Type          Low Level
  5017.  
  5018.           Description   This function  sets the  window co-ordinates  for a
  5019.                         DOS Window. Using this function in combination with
  5020.                         set_int10 allows  you to set up a window into which
  5021.                         all local  screen output will be directed. Topr and
  5022.                         topc are the top left corner of the window and botr
  5023.                         and botc are the bottom right corner of the window.
  5024.                         All co-ordinates are 0 based.
  5025.  
  5026.           Return Value  None.
  5027.  
  5028.           Example
  5029.  
  5030.              _dos_allocmem(114,&dseg);       // get some memory
  5031.              save_screen(3,8,16,71,dseg);    // save a part of screen
  5032.              set_int10();                    // set up BIOS trap
  5033.              set_cord(4,9,15,70);            // tell it what to protect
  5034.              set_attr(14,1);                 // Yellow on Blue
  5035.              cls_all();                      // clear the window
  5036.              system("COMMAND");              // go to DOS
  5037.              rest_int10();                   // restore vector
  5038.              restore_screen(3,8,16,71,dseg); // restore screen
  5039.              _dos_freemem(dseg);             // free memory
  5040.  
  5041.  
  5042.  
  5043.  
  5044.  
  5045.  
  5046.  
  5047.  
  5048.  
  5049.  
  5050.  
  5051.  
  5052.                                        Page 88
  5053.  
  5054.  
  5055.  
  5056.           GAP Communications                                         GAPCDR
  5057.  
  5058.  
  5059.           set_int10
  5060.           -----------------------------------------------------------------
  5061.  
  5062.           Purpose       Set up an interrupt 10 (BIOS) trapper.
  5063.  
  5064.                         void set_int10(void);
  5065.  
  5066.           Type          Low Level
  5067.  
  5068.           Description   This function intercepts the Interrupt 10 vector so
  5069.                         that it  can trap  calls to  the BIOS  video output
  5070.                         routines. It  is used  in conjunction with set_cord
  5071.                         to set  up a  portion of  the screen into which all
  5072.                         video output  through the BIOS will be directed. If
  5073.                         a console driver other than CON or ANSI.SYS is used
  5074.                         that writes  directly to  the screen, this function
  5075.                         will not work.
  5076.  
  5077.           Return Value  None.
  5078.  
  5079.           Example       See the example for set_cord.
  5080.  
  5081.  
  5082.  
  5083.  
  5084.  
  5085.  
  5086.  
  5087.  
  5088.  
  5089.  
  5090.  
  5091.  
  5092.  
  5093.  
  5094.  
  5095.  
  5096.  
  5097.  
  5098.  
  5099.  
  5100.  
  5101.  
  5102.  
  5103.  
  5104.  
  5105.  
  5106.  
  5107.  
  5108.  
  5109.  
  5110.                                        Page 89
  5111.  
  5112.  
  5113.  
  5114.           GAP Communications                                         GAPCDR
  5115.  
  5116.  
  5117.           set_status
  5118.           -----------------------------------------------------------------
  5119.  
  5120.           Purpose       Displays and updates the sysop status line.
  5121.  
  5122.                         void set_status(short how);
  5123.  
  5124.                         how        0 = set the status line
  5125.                                    1 = update the status line
  5126.                                    4 = show other user stats
  5127.  
  5128.  
  5129.           Type          High Level
  5130.  
  5131.           Description   Displays or updates the sysop status line.
  5132.  
  5133.           Return Value  None.
  5134.  
  5135.           Example       set_status(0);    // display status line
  5136.  
  5137.  
  5138.  
  5139.  
  5140.  
  5141.  
  5142.  
  5143.  
  5144.  
  5145.  
  5146.  
  5147.  
  5148.  
  5149.  
  5150.  
  5151.  
  5152.  
  5153.  
  5154.  
  5155.  
  5156.  
  5157.  
  5158.  
  5159.  
  5160.  
  5161.  
  5162.  
  5163.  
  5164.  
  5165.  
  5166.  
  5167.  
  5168.                                        Page 90
  5169.  
  5170.  
  5171.  
  5172.           GAP Communications                                         GAPCDR
  5173.  
  5174.  
  5175.           show_file
  5176.           -----------------------------------------------------------------
  5177.  
  5178.           Purpose       Displays a text file.
  5179.  
  5180.                         void show_file(char *filename);
  5181.  
  5182.                         filename   Full path and name of file to display
  5183.  
  5184.           Type          High Level
  5185.  
  5186.           Description   Many door  programs have  welcome, news, exit, help
  5187.                         and other  files to  show to  the user  at  various
  5188.                         points in  the program.  This is  the function that
  5189.                         allows you  to do  that. To  display a  file to the
  5190.                         user,   call    the   function    with   the   full
  5191.                         drive\path\filename of the file to display.
  5192.  
  5193.                         If you  have color  and non-color versions of files
  5194.                         pass the  name of  the non-color  version  as  this
  5195.                         function will  automatically append  a "G"  to  the
  5196.                         filename if  the user  is in  color mode.  In fact,
  5197.                         this function will always try to find a file with a
  5198.                         "G" appended to the end of the name (if the user is
  5199.                         in color  mode) before it looks for the actual file
  5200.                         by the  name you  specified. If you pass "WELCOMEG"
  5201.                         to this  function and the user is in color mode, it
  5202.                         will first  try to  find a  file with  the name  of
  5203.                         "WELCOMEGG".
  5204.  
  5205.                         Pressing CTRL-K  or  CTRL-X  will  abort  any  file
  5206.                         display.
  5207.  
  5208.                         REMEMBER :  If you  have both  color and  non-color
  5209.                         versions of  the same  files, pass  the name of the
  5210.                         non-color version. Also, the actual disk files must
  5211.                         be named  in such  a way  that they  have  no  file
  5212.                         extension and the color version ends with a "G".
  5213.  
  5214.           Return Value  None.
  5215.  
  5216.           Example       show_file("WELCOME");     // display welcome file
  5217.  
  5218.  
  5219.  
  5220.  
  5221.  
  5222.  
  5223.  
  5224.  
  5225.  
  5226.                                        Page 91
  5227.  
  5228.  
  5229.  
  5230.           GAP Communications                                         GAPCDR
  5231.  
  5232.  
  5233.           show_mess
  5234.           -----------------------------------------------------------------
  5235.  
  5236.           Purpose       Displays a message.
  5237.  
  5238.                         void show_mess(char *message,short bell,
  5239.                                        short newline);
  5240.  
  5241.                         message    Message to display.
  5242.                         bell       YES or NO to ring the bell.
  5243.                         newline    YES or NO to issue a CR/LF after
  5244.                                    message.
  5245.  
  5246.           Type          High Level
  5247.  
  5248.           Description   This is the main string output function for GAPCDR.
  5249.                         Under most circumstances, this is the only function
  5250.                         that you would call to display output to the user.
  5251.  
  5252.           Return Value  None
  5253.  
  5254.           Example       show_mess("This is a message!",NO,YES);
  5255.  
  5256.              // the first show_mess displays the string and leaves the
  5257.              // cursor on the same line. The second displays the
  5258.              // string, rings the remote user's bell, and drops the
  5259.              // cursor to the next line.
  5260.  
  5261.              nl(1);
  5262.              show_mess("Are you ready? (Y/N) : ",NO,NO);
  5263.  
  5264.              empty(response,3);
  5265.              get_string(response);
  5266.  
  5267.              if (response[0] == 'Y')
  5268.                // begin whatever it is you want to begin
  5269.              else
  5270.                show_mess("Too Bad!",YES,YES);
  5271.  
  5272.  
  5273.  
  5274.  
  5275.  
  5276.  
  5277.  
  5278.  
  5279.  
  5280.  
  5281.  
  5282.  
  5283.  
  5284.                                        Page 92
  5285.  
  5286.  
  5287.  
  5288.           GAP Communications                                         GAPCDR
  5289.  
  5290.  
  5291.           timer
  5292.           -----------------------------------------------------------------
  5293.  
  5294.           Purpose       Pauses for the number of "ticks" specified.
  5295.  
  5296.                         void timer(short ticks);
  5297.  
  5298.                         ticks      Number of timer ticks to pause.
  5299.  
  5300.           Type          High Level
  5301.  
  5302.           Description   This function  allows you  to pause  all processing
  5303.                         for the  specified  number  of  ticks.  It  is  in-
  5304.                         sensitive to processor speed.
  5305.  
  5306.                         The function  simply delays  the number  of "ticks"
  5307.                         indicated by  the passed  parameter. Each  tick  is
  5308.                         1/18 of a second (or 55 miliseconds).
  5309.  
  5310.           Return Value  None.
  5311.  
  5312.           Example       timer(18);      // pause for 1 second
  5313.  
  5314.  
  5315.  
  5316.  
  5317.  
  5318.  
  5319.  
  5320.  
  5321.  
  5322.  
  5323.  
  5324.  
  5325.  
  5326.  
  5327.  
  5328.  
  5329.  
  5330.  
  5331.  
  5332.  
  5333.  
  5334.  
  5335.  
  5336.  
  5337.  
  5338.  
  5339.  
  5340.  
  5341.  
  5342.                                        Page 93
  5343.  
  5344.  
  5345.  
  5346.           GAP Communications                                         GAPCDR
  5347.  
  5348.  
  5349.           time_credit
  5350.           -----------------------------------------------------------------
  5351.  
  5352.           Purpose       Issues timecredits to user.
  5353.  
  5354.                         void time_credit(short flag);
  5355.  
  5356.                         flag       1 = start timer
  5357.                                    0 = end timer
  5358.  
  5359.  
  5360.           Type          High Level
  5361.  
  5362.           Description   This is  basically an  internal routine  called  by
  5363.                         chat and sysop shell to DOS so that the user is not
  5364.                         penalized  for  time  used.  It  updates  a  global
  5365.                         variable called  timecredit. Timecredit  is used in
  5366.                         the calculations  that determine  the  user's  time
  5367.                         remaining.
  5368.  
  5369.                         If you  wish to  use this  feature in your own rou-
  5370.                         tines,  prior   to  entering   your  routine,  call
  5371.                         time_credit with  a 1  and it will start the timer.
  5372.                         When your  routine is  finished,  call  time_credit
  5373.                         with a  0 and  the timer  will stop.  The  variable
  5374.                         timecredit will be updated with the elapsed time.
  5375.  
  5376.           Return Value  None.
  5377.  
  5378.           Example       time_credit(1);   // start the timer
  5379.  
  5380.              time_credit(1);              // start the timer
  5381.              do_chat();  // chat with user
  5382.              time_credit(0);              // stop the timer
  5383.  
  5384.  
  5385.  
  5386.  
  5387.  
  5388.  
  5389.  
  5390.  
  5391.  
  5392.  
  5393.  
  5394.  
  5395.  
  5396.  
  5397.  
  5398.  
  5399.  
  5400.                                        Page 94
  5401.  
  5402.  
  5403.  
  5404.           GAP Communications                                         GAPCDR
  5405.  
  5406.  
  5407.           time_left
  5408.           -----------------------------------------------------------------
  5409.  
  5410.           Purpose       To compute the user's time remaining.
  5411.  
  5412.                         void time_left(void);
  5413.  
  5414.           Type          High Level
  5415.  
  5416.           Description   This is  the function  that is  called by the input
  5417.                         and output  routines to  compute  the  user's  time
  5418.                         remaining. It  is not  necessary for the programmer
  5419.                         to call this routine directly.
  5420.  
  5421.                         A global  variable called  timeleft will be updated
  5422.                         with each  call.  This  variable  may  be  used  in
  5423.                         prompts that display the user's remaining time.
  5424.  
  5425.                         As long as all input/output is performed thru calls
  5426.                         to the  GAPCDR library,  the timeleft variable will
  5427.                         always be current.
  5428.  
  5429.           Return Value  None.
  5430.  
  5431.           Example       time_left();      // calculate time remaining
  5432.  
  5433.  
  5434.  
  5435.  
  5436.  
  5437.  
  5438.  
  5439.  
  5440.  
  5441.  
  5442.  
  5443.  
  5444.  
  5445.  
  5446.  
  5447.  
  5448.  
  5449.  
  5450.  
  5451.  
  5452.  
  5453.  
  5454.  
  5455.  
  5456.  
  5457.  
  5458.                                        Page 95
  5459.  
  5460.  
  5461.  
  5462.           GAP Communications                                         GAPCDR
  5463.  
  5464.  
  5465.           trim
  5466.           -----------------------------------------------------------------
  5467.  
  5468.           Purpose       Trims  spaces  from  the  end  of  NULL  terminated
  5469.                         strings.
  5470.  
  5471.                         char *trim(char *string);
  5472.  
  5473.                         string     String containing trailing spaces
  5474.  
  5475.           Type          High Level
  5476.  
  5477.           Description   This function  will remove  any spaces from the end
  5478.                         of a string. It modifies the passed string.
  5479.  
  5480.           Return Value  Pointer to the string without the spaces.
  5481.  
  5482.           Example       trim(username);           // get rid of spaces
  5483.  
  5484.  
  5485.  
  5486.  
  5487.  
  5488.  
  5489.  
  5490.  
  5491.  
  5492.  
  5493.  
  5494.  
  5495.  
  5496.  
  5497.  
  5498.  
  5499.  
  5500.  
  5501.  
  5502.  
  5503.  
  5504.  
  5505.  
  5506.  
  5507.  
  5508.  
  5509.  
  5510.  
  5511.  
  5512.  
  5513.  
  5514.  
  5515.  
  5516.                                        Page 96
  5517.  
  5518.  
  5519.  
  5520.           GAP Communications                                         GAPCDR
  5521.  
  5522.  
  5523.           update_clock
  5524.           -----------------------------------------------------------------
  5525.  
  5526.           Purpose       Updates the status line clock.
  5527.  
  5528.                         void update_clock(void);
  5529.  
  5530.           Type          High Level
  5531.  
  5532.           Description   Internal routine to update the status line clock.
  5533.  
  5534.           Return Value  None.
  5535.  
  5536.           Example
  5537.  
  5538.  
  5539.  
  5540.  
  5541.  
  5542.  
  5543.  
  5544.  
  5545.  
  5546.  
  5547.  
  5548.  
  5549.  
  5550.  
  5551.  
  5552.  
  5553.  
  5554.  
  5555.  
  5556.  
  5557.  
  5558.  
  5559.  
  5560.  
  5561.  
  5562.  
  5563.  
  5564.  
  5565.  
  5566.  
  5567.  
  5568.  
  5569.  
  5570.  
  5571.  
  5572.  
  5573.  
  5574.                                        Page 97
  5575.  
  5576.  
  5577.  
  5578.           GAP Communications                                         GAPCDR
  5579.  
  5580.  
  5581.           wrap_word
  5582.           -----------------------------------------------------------------
  5583.  
  5584.           Purpose       To wrap a word during sysop chats.
  5585.  
  5586.                         void wrap_word(void);
  5587.  
  5588.           Type          Low Level
  5589.  
  5590.           Description   Internal function called by putkey to wrap words.
  5591.  
  5592.           Return Value  None.
  5593.  
  5594.           Example
  5595.  
  5596.  
  5597.  
  5598.  
  5599.  
  5600.  
  5601.  
  5602.  
  5603.  
  5604.  
  5605.  
  5606.  
  5607.  
  5608.  
  5609.  
  5610.  
  5611.  
  5612.  
  5613.  
  5614.  
  5615.  
  5616.  
  5617.  
  5618.  
  5619.  
  5620.  
  5621.  
  5622.  
  5623.  
  5624.  
  5625.  
  5626.  
  5627.  
  5628.  
  5629.  
  5630.  
  5631.  
  5632.                                        Page 98
  5633.  
  5634.  
  5635.  
  5636.           GAP Communications                                         GAPCDR
  5637.  
  5638.  
  5639.           write_gapuser
  5640.           -----------------------------------------------------------------
  5641.  
  5642.           Purpose       Updates the user record in GAP's USERS.DAT file.
  5643.  
  5644.                         short write_gapuser(char *path);
  5645.  
  5646.                         path       Full path and name of Users File
  5647.  
  5648.           Type          High Level
  5649.  
  5650.           Description   This function allows you to update any variables in
  5651.                         the GAP  USERS.DAT file  for the  current user. You
  5652.                         must first  read the  user record  before  you  can
  5653.                         write to it.
  5654.  
  5655.                         You must  pass the path and name of the Users file.
  5656.                         The  name   is  obtained   by  reading  GAPBBS.CNF.
  5657.                         Write_gapuser will add the .DAT extension.
  5658.  
  5659.                         WARNING :  The GAP  USERS.DAT file contains strings
  5660.                         that are  fully padded  with spaces.  If you modify
  5661.                         any of  these strings,  you MUST make sure that the
  5662.                         string is  fully padded  with spaces  and that  the
  5663.                         NULL character  is placed  in the last string posi-
  5664.                         tion.
  5665.  
  5666.                         WARNING : The indexes for the user file consists of
  5667.                         the user's  last name and first name, user's level,
  5668.                         and user's  handle. Do  not under any circumstances
  5669.                         modify either  of these  four fields. Doing so will
  5670.                         cause corruption of the Index file.
  5671.  
  5672.           Return Value  0 = no error, 1 = error.
  5673.  
  5674.  
  5675.  
  5676.  
  5677.  
  5678.  
  5679.  
  5680.  
  5681.  
  5682.  
  5683.  
  5684.  
  5685.  
  5686.  
  5687.  
  5688.  
  5689.  
  5690.                                        Page 99
  5691.  
  5692.  
  5693.  
  5694.           GAP Communications                                         GAPCDR
  5695.  
  5696.  
  5697.           Example       c = write_gapuser(userpath);
  5698.  
  5699.              // allow user to change city and state
  5700.  
  5701.              c = read_gapuser(userpath);
  5702.  
  5703.              if (c == 0)
  5704.                {
  5705.                show_mess("Enter City/State : ",NO,NO);
  5706.  
  5707.                empty(city,29);            // clear string
  5708.                get_string(city);          // get response
  5709.  
  5710.                if (city[0] != 0)          // if something entered
  5711.                  {
  5712.                  strcpy(user.city,city);  // copy it
  5713.                  pad(user.city,29);       // pad it with spaces
  5714.                  c = write_gapuser(userpath);     // update user record
  5715.  
  5716.                  if (c == 0)
  5717.                    show_mess("Saved new City",NO,YES);
  5718.                  }
  5719.                }
  5720.  
  5721.  
  5722.  
  5723.  
  5724.  
  5725.  
  5726.  
  5727.  
  5728.  
  5729.  
  5730.  
  5731.  
  5732.  
  5733.  
  5734.  
  5735.  
  5736.  
  5737.  
  5738.  
  5739.  
  5740.  
  5741.  
  5742.  
  5743.  
  5744.  
  5745.  
  5746.  
  5747.  
  5748.                                       Page 100
  5749.  
  5750.  
  5751.  
  5752.           GAP Communications                                         GAPCDR
  5753.  
  5754.  
  5755.           write_pcbsys
  5756.           -----------------------------------------------------------------
  5757.  
  5758.           Purpose       Updates the PCBOARD.SYS file.
  5759.  
  5760.                         short write_pcbsys(void);
  5761.  
  5762.           Type          High Level
  5763.  
  5764.           Description   This function  allows the  programmer to update the
  5765.                         PCBOARD.SYS File.  You must  first  read  the  file
  5766.                         before you  write to it and you should not use this
  5767.                         function unless  you  know  that  your  program  is
  5768.                         running with PCB as the host system.
  5769.  
  5770.           Return Value  0 = no error, 1 = error.
  5771.  
  5772.           Example       c = write_pcbsys()        // write the file
  5773.  
  5774.  
  5775.  
  5776.  
  5777.  
  5778.  
  5779.  
  5780.  
  5781.  
  5782.  
  5783.  
  5784.  
  5785.  
  5786.  
  5787.  
  5788.  
  5789.  
  5790.  
  5791.  
  5792.  
  5793.  
  5794.  
  5795.  
  5796.  
  5797.  
  5798.  
  5799.  
  5800.  
  5801.  
  5802.  
  5803.  
  5804.  
  5805.  
  5806.                                       Page 101
  5807.  
  5808.  
  5809.  
  5810.           GAP Communications                                         GAPCDR
  5811.  
  5812.  
  5813.           write_pcbuser
  5814.           -----------------------------------------------------------------
  5815.  
  5816.           Purpose       Updates the PCB USERS file.
  5817.  
  5818.                         short write_pcbuser(char *path);
  5819.  
  5820.                         path       Full path and name to the Users file
  5821.  
  5822.           Type          High Level
  5823.  
  5824.           Description   This function  allows the  programmer to update the
  5825.                         PCB USERS  File. Do  not use  unless you  know your
  5826.                         program is  running under  a PCB  host system.  You
  5827.                         must first  read the  user record  before  you  can
  5828.                         write to it.
  5829.  
  5830.                         You must  pass the path and name of the Users file.
  5831.                         The name is obtained by reading PCBOARD.DAT.
  5832.  
  5833.           Return Value  0 = no error, 1 = error.
  5834.  
  5835.           Example       c = write_pcbuser();      // write the file
  5836.  
  5837.  
  5838.  
  5839.  
  5840.  
  5841.  
  5842.  
  5843.  
  5844.  
  5845.  
  5846.  
  5847.  
  5848.  
  5849.  
  5850.  
  5851.  
  5852.  
  5853.  
  5854.  
  5855.  
  5856.  
  5857.  
  5858.  
  5859.  
  5860.  
  5861.  
  5862.  
  5863.  
  5864.                                       Page 102
  5865.  
  5866.  
  5867.  
  5868.           GAP Communications                                         GAPCDR
  5869.  
  5870.  
  5871.           write_score
  5872.           -----------------------------------------------------------------
  5873.  
  5874.           Purpose       Creates and maintains a scoreboard.
  5875.  
  5876.                         void write_score(char *filename,long score);
  5877.  
  5878.                         filename   Path and name of data file to write to
  5879.                         score      Score to write
  5880.  
  5881.           Type          High Level
  5882.  
  5883.           Description   This function will create and maintain a scoreboard
  5884.                         of the top ten players. You pass it two parameters.
  5885.                         The first  is a  string containing  the name of the
  5886.                         data file  to create/maintain. The second is a long
  5887.                         unsigned integer containing the score to write. The
  5888.                         user's name and the current date are already known.
  5889.                         If the  sysop is  in the  door  at  the  time,  the
  5890.                         function will  simply return and not write a score.
  5891.                         The  scores   will  automatically   be  sorted   in
  5892.                         decreasing order  by the highest score. If you wish
  5893.                         to use  this routine  but your  points are  kept as
  5894.                         shorts instead  of longs,  simply cast  the  second
  5895.                         parameter to an unsigned long.
  5896.  
  5897.           Return Value  None.
  5898.  
  5899.           Example
  5900.  
  5901.              short points;
  5902.  
  5903.              points = 1000;
  5904.              write_score("TOURIST.DAT,(unsigned long) points);
  5905.  
  5906.  
  5907.  
  5908.  
  5909.  
  5910.  
  5911.  
  5912.  
  5913.  
  5914.  
  5915.  
  5916.  
  5917.  
  5918.  
  5919.  
  5920.  
  5921.  
  5922.                                       Page 103
  5923.  
  5924.  
  5925.  
  5926.           GAP Communications                                         GAPCDR
  5927.  
  5928.  
  5929.           Index
  5930.  
  5931.  
  5932.           Access1   27, 29
  5933.           Alarm     23
  5934.           Ansi 27, 30
  5935.           Ansi driver
  5936.             color   7, 49, 51, 64
  5937.             external     18, 20
  5938.             initializing 11, 58
  5939.             internal     7, 12, 49
  5940.           ANSI variables 8, 22
  5941.           Anystring 26
  5942.           Backspace 26, 27, 31
  5943.           Base address   9, 15, 25, 71, 85
  5944.           Base_add  25, 71, 85
  5945.           Batch file     16
  5946.           Baud 18, 19, 20, 23, 61
  5947.           Baud rate 6, 18, 19, 20, 23, 61, 85
  5948.           BBS
  5949.             default directory 26, 71
  5950.             name    26
  5951.             system files 14, 26, 74, 75, 76, 99, 101, 102
  5952.           Bbs_dir   26, 71
  5953.           Bell 23, 92
  5954.           Birthday  26
  5955.           Board_name     26
  5956.           Bphone    24
  5957.           BS   26
  5958.           Business phone number    24
  5959.           Caller alarm   23
  5960.           Caller's birth date 26
  5961.           Carriage return     26
  5962.           Carrier   18, 19, 62, 67
  5963.           Characters
  5964.             sending to com port    27, 40
  5965.             sending to local & remote   27, 50
  5966.             sending to local screen     27, 64
  5967.           Chat 17, 25, 43, 70
  5968.           Chatting with user  25
  5969.           City 24
  5970.           Ckeypress 27, 32
  5971.           Clear_scrn     27, 33
  5972.           Clockon   25, 97
  5973.           Clr_buf   27, 34
  5974.           Cls  27, 33, 35
  5975.           Cls_all   27, 36
  5976.           Color     7, 20, 23, 25, 30, 49, 51, 54, 64, 86
  5977.  
  5978.  
  5979.  
  5980.                                       Page 104
  5981.  
  5982.  
  5983.  
  5984.           GAP Communications                                         GAPCDR
  5985.  
  5986.  
  5987.           Column    25
  5988.           Comgetc   20, 27, 37
  5989.           Comgetd   20, 27, 38
  5990.           Communications
  5991.             advanced applications  18
  5992.             base address 9, 15, 25, 71, 85
  5993.             baud rates   6, 18, 19, 20, 23, 85
  5994.             carrier 18, 19, 62, 67
  5995.             configuration file     9
  5996.             DTR     20
  5997.             FIFO buffers 6
  5998.             Functions
  5999.               clr_buf    27, 34
  6000.               comgetc    27, 37
  6001.               comgetd    27, 38
  6002.               computb    27, 39
  6003.               computc    27, 40
  6004.               computs    27, 41
  6005.               dtr   27, 44
  6006.               init_port  19, 20, 27, 61
  6007.               iscd  27, 62
  6008.               no_carrier 27, 67
  6009.               reset_port 19, 28, 78
  6010.               rts   28, 82
  6011.               rxempty    28, 83
  6012.               setport    19, 28, 85
  6013.             initializing 19, 59, 60, 61, 85
  6014.             input   20, 37, 38, 83
  6015.             interrupt    11, 19, 63, 78
  6016.             IRQ     9, 15, 25, 71, 85
  6017.             output  20, 39, 40, 41
  6018.             port    11, 12, 18, 23, 71, 85
  6019.           Compilers
  6020.             compiling & linking    12
  6021.             cputs   12
  6022.             floating point    8, 13, 55
  6023.             function calling  13
  6024.             goto    13
  6025.             header files 8, 53
  6026.             printf  12
  6027.             supported    8
  6028.           Compiling 12
  6029.           Computb   27, 39
  6030.           Computc   20, 27, 40
  6031.           Computs   20, 27, 41
  6032.           Configuration file  9, 11, 15, 16, 71
  6033.             format  9, 15
  6034.           Control characters  8
  6035.  
  6036.  
  6037.  
  6038.                                       Page 105
  6039.  
  6040.  
  6041.  
  6042.           GAP Communications                                         GAPCDR
  6043.  
  6044.  
  6045.             editor  8
  6046.           Cputs     12
  6047.           CRLF 26, 51
  6048.           Ctrl-Break handler  11, 80, 87
  6049.           Curbytes  24
  6050.           Curfiles  23
  6051.           Current display color    25
  6052.           Current download bytes   24
  6053.           Current files downloaded 23
  6054.           Current time   25
  6055.           Cursoff   27, 42
  6056.           Curson    27, 42
  6057.           Cursor    27, 42
  6058.           Curtime   26
  6059.           Date user's subscription expires   24
  6060.           Default color  23
  6061.           Delaying  93
  6062.           DESQview  19, 27, 32, 38, 45, 46, 47
  6063.           Dflt_color     23
  6064.           Display clock  25
  6065.           Display color  25
  6066.           Distribution files  7
  6067.           Do_chat   27, 43
  6068.           DOOR.SYS  7, 9, 12, 14, 26, 73
  6069.             Universal format  7
  6070.             Variables    23
  6071.           Doors     16
  6072.           Doors opened   24
  6073.           Doors_opened   24
  6074.           DOS shell 17, 20
  6075.           DOS Window     20, 54, 79, 81, 84, 86, 88, 89
  6076.           Downbytes 24
  6077.           Download bytes 24
  6078.           Downloads 24
  6079.           DSZ  20
  6080.           DTR  20, 27, 44
  6081.           Dv_here   19, 27, 45
  6082.           Dv_pause  18, 27, 32, 46, 47
  6083.           Editor    8
  6084.             control characters     8
  6085.           Elap_time 27, 47
  6086.           Empty     27, 48, 56
  6087.           Endview   25
  6088.           Event_time     24
  6089.           Expert    23
  6090.           Files
  6091.             checking for existence of   27, 29
  6092.             configuration     9, 15
  6093.  
  6094.  
  6095.  
  6096.                                       Page 106
  6097.  
  6098.  
  6099.  
  6100.           GAP Communications                                         GAPCDR
  6101.  
  6102.  
  6103.             displaying   25, 91
  6104.             DOOR.SYS     7, 9, 14
  6105.             GAPCDR.H     8, 11
  6106.             GAPSTRUC.H   8
  6107.             PCBOARD.SYS  14
  6108.           First name     24
  6109.           Fix_color 27, 49
  6110.           Flag 25
  6111.           Floating point 8, 13, 55
  6112.           Fname     24
  6113.           Full name 24
  6114.           Function calling    13
  6115.           Function keys  17
  6116.           Functions
  6117.             access1 27, 29
  6118.             ansi    30
  6119.             backspace    31
  6120.             ckeypress    32
  6121.             clear_scrn   33
  6122.             clr_buf 34
  6123.             cls     33, 35
  6124.             cls_all 36
  6125.             comgetc 20, 37
  6126.             comgetd 20, 38
  6127.             computb 39
  6128.             computc 20, 40
  6129.             computs 20, 41
  6130.             cursoff 42
  6131.             curson  42
  6132.             do_chat 43
  6133.             DOS Window   20
  6134.             dtr     44
  6135.             dv_here 19, 45
  6136.             dv_pause     18, 46
  6137.             elap_time    47
  6138.             empty   48, 56
  6139.             fix_color    49
  6140.             gapputc 50
  6141.             gapputs 51
  6142.             get_attr     20, 54
  6143.             get_random   55
  6144.             get_string   48, 56
  6145.             getakey 52
  6146.             getkeyc 53
  6147.             init_ansi    58
  6148.             init_com     59
  6149.             init_door    10, 11, 60
  6150.             init_port    19, 20, 61
  6151.  
  6152.  
  6153.  
  6154.                                       Page 107
  6155.  
  6156.  
  6157.  
  6158.           GAP Communications                                         GAPCDR
  6159.  
  6160.  
  6161.             iscd    62
  6162.             leave   11, 12, 63
  6163.             lputc   64
  6164.             lputs   64
  6165.             more    65
  6166.             nl 66
  6167.             no_carrier   18, 67
  6168.             pagesysop    68
  6169.             pause   69
  6170.             putkey  70
  6171.             read_cnf     9, 10, 11, 71
  6172.             read_doorsys 73
  6173.             read_gapuser 12, 74
  6174.             read_pcbsys  12, 75
  6175.             read_pcbuser 76
  6176.             read_score   77
  6177.             reset_port   19, 78
  6178.             rest_cbreak  80
  6179.             rest_int10   81
  6180.             restore_screen    79
  6181.             rts     82
  6182.             rxempty 83
  6183.             save_screen  84
  6184.             set_attr     86
  6185.             set_cbreak   87
  6186.             set_cord     88
  6187.             set_int10    89
  6188.             set_port     19
  6189.             set_status   90
  6190.             setport 85
  6191.             show_file    91
  6192.             show_mess    51, 92
  6193.             time_credit  94
  6194.             time_left    95
  6195.             timer   18, 93
  6196.             trim    96
  6197.             update_clock 97
  6198.             wrap_word    98
  6199.             write_gapuser     99
  6200.             write_pcbsys 101
  6201.             write_pcbuser     102
  6202.             write_score  103
  6203.           GAPCDR.H  11
  6204.           Gapputc   27, 50
  6205.           Gapputs   27, 51
  6206.           GAPSTRUC.H     8, 53
  6207.           Gendir    26
  6208.           Get_attr  20, 27, 54
  6209.  
  6210.  
  6211.  
  6212.                                       Page 108
  6213.  
  6214.  
  6215.  
  6216.           GAP Communications                                         GAPCDR
  6217.  
  6218.  
  6219.           Get_random     27, 55
  6220.           Get_string     27, 48, 56
  6221.           Getakey   27, 52
  6222.           Getkeyc   27, 53
  6223.           Gotdv     18
  6224.           Goto 13
  6225.           Handle    24
  6226.           Header files
  6227.             GAPCDR.H     8, 11
  6228.             GAPSTRUC.H   8, 53
  6229.           Home phone number   24
  6230.           Hphone    24
  6231.           Init_ansi 27, 58
  6232.           Init_com  27, 59
  6233.           Init_door 10, 11, 27, 60
  6234.           Init_port 19, 20, 27, 61
  6235.           Initializing
  6236.             ANSI driver  11, 49, 58
  6237.             interrupt handlers     11, 85
  6238.             program 11, 54, 58, 59, 60, 71, 73, 85, 87
  6239.             strings 27, 48, 56
  6240.           Input
  6241.             from com port     20, 27, 37, 38, 83
  6242.             from local & remote    27, 32, 46, 52, 56
  6243.             from local keyboard    27, 53
  6244.           Instatus  25
  6245.           Interrupt handlers
  6246.             BIOS    81, 89
  6247.             communications    19, 63, 78
  6248.             CTRL-Break   11, 63, 80, 87
  6249.           IRQ  9, 15, 25, 71, 85
  6250.           Iscd 27, 62
  6251.           Keyboard  32, 46, 52, 53, 56
  6252.             timeout 32, 56
  6253.           Last date user was on    24
  6254.           Last name 24
  6255.           Last new files scan 24
  6256.           Last_new  24
  6257.           Lastdate  24
  6258.           Leave     11, 12, 27, 63
  6259.           Level     23
  6260.           Line feed 26
  6261.           Lines     25, 65, 66
  6262.           Linking   12
  6263.           Lname     24
  6264.           Local     18, 23
  6265.             Functions
  6266.               cls   27, 35
  6267.  
  6268.  
  6269.  
  6270.                                       Page 109
  6271.  
  6272.  
  6273.  
  6274.           GAP Communications                                         GAPCDR
  6275.  
  6276.  
  6277.               cls_all    27, 36
  6278.               cursoff    27, 42
  6279.               curson     27, 42
  6280.               getkeyc    27, 53
  6281.               lputc 27, 64
  6282.               lputs 27, 64
  6283.           Local mode     12, 18
  6284.           Lowercase characters     25, 56
  6285.           Lputc     27, 64
  6286.           Lputs     27, 64
  6287.           Maindir   26
  6288.           Make_sound     27
  6289.           Maxbytes  24
  6290.           Maxfiles  23
  6291.           Maximum bytes available  24
  6292.           Maximum files available  23
  6293.           Mesleft   24
  6294.           Messages left  24
  6295.           Minsleft  23
  6296.           Minutes left at door start    23
  6297.           More prompt    25, 27, 65
  6298.           Multi     12, 23
  6299.           Multi user     12, 17, 29
  6300.           Name of the BBS     26
  6301.           NL   27, 66, 92
  6302.           No clock  25
  6303.           No_carrier     18, 19, 27, 67
  6304.           Node 23
  6305.           Node number    23
  6306.           Non Stop mode  25
  6307.           Normal    25
  6308.           Noup 25, 56
  6309.           Novice    23
  6310.           NS   25, 65
  6311.           Number of downloads 24
  6312.           Number of times on  24
  6313.           Output
  6314.             to com port  20, 27, 39, 40, 41
  6315.             to local & remote 27, 28, 50, 51, 92
  6316.             to local screen   27, 64
  6317.           Page 23
  6318.           Page bell 17, 23, 68
  6319.           Page length    23, 65
  6320.           Pagesysop 27, 68
  6321.           Parity    23
  6322.           Pascal
  6323.             function calling  13
  6324.           Password  24
  6325.  
  6326.  
  6327.  
  6328.                                       Page 110
  6329.  
  6330.  
  6331.  
  6332.           GAP Communications                                         GAPCDR
  6333.  
  6334.  
  6335.           Path to DOOR.SYS    26
  6336.           Pause     27, 69
  6337.           Pausing   93
  6338.           PCBOARD.SYS    14
  6339.           PKUNZIP   20
  6340.           Port 18, 19, 23, 71, 85
  6341.           Printer   23
  6342.           Printf    12
  6343.           Prompts
  6344.             more    65
  6345.             pause   69
  6346.           Putkey    27, 70
  6347.           Random number generator  11, 27, 55
  6348.           Read_cnf  9, 10, 11, 27, 71
  6349.           Read_doorsys   28, 73
  6350.           Read_gapuser   12, 28, 74
  6351.           Read_pcbsys    12, 28, 75
  6352.           Read_pcbuser   28, 76
  6353.           Read_score     28, 77
  6354.           Realcredit     23
  6355.           Receive buffer 32, 34, 37, 38, 83, 85
  6356.           Recnum    24
  6357.           Redisplay 25
  6358.           Remote user    23
  6359.           Remote user's bps rate   23
  6360.           Reset_port     19, 28, 78
  6361.           Rest_cbreak    28, 80
  6362.           Rest_int10     28, 81
  6363.           Restore_screen 28, 79
  6364.           Rts  28, 82
  6365.           Rxempty   28, 83
  6366.           Save_screen    28, 84
  6367.           Scan codes     53
  6368.           Scoreboard     77, 103
  6369.           Screen    23, 79, 84
  6370.             clearing     33, 35, 36
  6371.             color   54, 64, 86
  6372.             cursor  42
  6373.             full    65
  6374.           Set_attr  28, 86
  6375.           Set_cbreak     28, 87
  6376.           Set_cord  28, 88
  6377.           Set_int10 28, 89
  6378.           Set_status     28, 90
  6379.           Setport   19, 28, 85
  6380.           Shell to DOS   17
  6381.           Show_file 28, 91
  6382.           Show_mess 28, 51, 92
  6383.  
  6384.  
  6385.  
  6386.                                       Page 111
  6387.  
  6388.  
  6389.  
  6390.           GAP Communications                                         GAPCDR
  6391.  
  6392.  
  6393.           Single user    12, 23
  6394.           Starttime 25
  6395.           Status line
  6396.             displaying   17, 25, 90
  6397.             protected    17
  6398.           Strings
  6399.             initializing 27, 48, 56
  6400.             receiving from local & remote    27, 48, 56
  6401.             removing spaces from   96
  6402.             sending to com port    27, 41
  6403.             sending to local & remote   27, 51, 92
  6404.             sending to local screen     27, 64
  6405.           Strtime   26
  6406.           Structures     26
  6407.           Subscrip  24
  6408.           Sysname   26
  6409.           Sysop
  6410.             batch file   16
  6411.             function keys     17
  6412.             functions    14, 17
  6413.             setup   14
  6414.           Sysop's name   26
  6415.           System files   14, 74, 75, 76, 99, 101, 102
  6416.           Temptime  25
  6417.           Time 25
  6418.           Time credits   23, 94
  6419.           Time door opened    25
  6420.           Time slice     18, 32, 38, 45, 46, 47
  6421.           Time user has left  25, 47, 52, 95
  6422.           Time_credit    28, 94
  6423.           Time_left 28, 95
  6424.           Timecredit     14, 25
  6425.           Timeleft  25, 32, 52, 95
  6426.           Timenow   25
  6427.           Timeout   32
  6428.           Timer     18, 28, 93
  6429.           Timeson   24
  6430.           Total uploads  24
  6431.           Trim 28, 96
  6432.           Twit 17
  6433.           Upbytes   24
  6434.           Update_clock   28, 97
  6435.           Updating status line     25
  6436.           Upload bytes   24
  6437.           Uploads   24
  6438.           Uppercase characters     25, 56
  6439.           Usemore1  25
  6440.           User Record    26
  6441.  
  6442.  
  6443.  
  6444.                                       Page 112
  6445.  
  6446.  
  6447.  
  6448.           GAP Communications                                         GAPCDR
  6449.  
  6450.  
  6451.           User's birth date   26
  6452.           User's business phone    24
  6453.           User's first name   24
  6454.           User's full name    24
  6455.           User's Handle  24
  6456.           User's home phone   24
  6457.           User's home town    24
  6458.           User's last name    24
  6459.           User's password     24
  6460.           User's record number     24
  6461.           User's security level    23
  6462.           Userbaud  23
  6463.           Username  24
  6464.           Variables
  6465.             ANSI    8, 22
  6466.             Defines
  6467.               NO    22
  6468.               YES   22
  6469.             DOOR.SYS
  6470.               alarm 23
  6471.               baud  18, 23
  6472.               bell  23
  6473.               bphone     24
  6474.               city  24
  6475.               color 23
  6476.               curbytes   24
  6477.               curfiles   23
  6478.               dflt_color 23
  6479.               doors_open 24
  6480.               downbytes  24
  6481.               downloads  24
  6482.               event_time 24
  6483.               expert     23
  6484.               fname 24
  6485.               handle     24
  6486.               hphone     24
  6487.               last_new   24
  6488.               lastdate   24
  6489.               level 23
  6490.               lname 24
  6491.               local 18, 23
  6492.               maxbytes   24
  6493.               maxfiles   23
  6494.               mesleft    24
  6495.               minsleft   23
  6496.               multi 12, 23
  6497.               node  23
  6498.               page  23
  6499.  
  6500.  
  6501.  
  6502.                                       Page 113
  6503.  
  6504.  
  6505.  
  6506.           GAP Communications                                         GAPCDR
  6507.  
  6508.  
  6509.               parity     23
  6510.               password   24
  6511.               port  18, 19, 23
  6512.               printer    23
  6513.               realcredit 23
  6514.               recnum     24
  6515.               screen     23
  6516.               subscrip   24
  6517.               timeson    24
  6518.               upbytes    24
  6519.               uploads    24
  6520.               userbaud   23
  6521.               username   24
  6522.             Global
  6523.               anystring  26
  6524.               base_add   25
  6525.               bbs_dir    26
  6526.               birthday   26
  6527.               board_name 26
  6528.               BS    26
  6529.               chat  25
  6530.               clockon    25
  6531.               column     25
  6532.               CRLF  26, 51
  6533.               curtime    26
  6534.               endview    25
  6535.               flag  25
  6536.               gendir     26
  6537.               gotdv 18
  6538.               instatus   25
  6539.               IRQ   25
  6540.               lines 25
  6541.               maindir    26
  6542.               normal     25
  6543.               noup  25, 56
  6544.               NS    25
  6545.               redisplay  25
  6546.               starttime  25
  6547.               strtime    26
  6548.               sysname    26
  6549.               temptime   25
  6550.               timecredit 14, 25
  6551.               timeleft   25
  6552.               timenow    25
  6553.               usemore1   25
  6554.               view  25
  6555.               wordwrap   25
  6556.             Structures
  6557.  
  6558.  
  6559.  
  6560.                                       Page 114
  6561.  
  6562.  
  6563.  
  6564.           GAP Communications                                         GAPCDR
  6565.  
  6566.  
  6567.               pcbsys     26
  6568.               pcbuser    26
  6569.               user  26
  6570.           View 25
  6571.           Window    20, 79, 81, 84, 86, 88, 89
  6572.           Wordwrap  25, 70, 98
  6573.           Wrap_word 28, 98
  6574.           Write_gapuser  28, 99
  6575.           Write_pcbsys   28, 101
  6576.           Write_pcbuser  28, 102
  6577.           Write_score    28, 103
  6578.  
  6579.  
  6580.  
  6581.  
  6582.  
  6583.  
  6584.  
  6585.  
  6586.  
  6587.  
  6588.  
  6589.  
  6590.  
  6591.  
  6592.  
  6593.  
  6594.  
  6595.  
  6596.  
  6597.  
  6598.  
  6599.  
  6600.  
  6601.  
  6602.  
  6603.  
  6604.  
  6605.  
  6606.  
  6607.  
  6608.  
  6609.  
  6610.  
  6611.  
  6612.  
  6613.  
  6614.  
  6615.  
  6616.  
  6617.  
  6618.                                       Page 115